Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
6540b1f3
Commit
6540b1f3
authored
Jan 31, 2016
by
Vedran Pavic
Committed by
Andy Wilkinson
Feb 08, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Docker container after launch script test execution
Closes gh-5059
parent
29c7b936
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
SysVinitLaunchScriptIT.java
...ngframework/boot/launchscript/SysVinitLaunchScriptIT.java
+23
-18
No files found.
spring-boot-integration-tests/spring-boot-launch-script-tests/src/test/java/org/springframework/boot/launchscript/SysVinitLaunchScriptIT.java
View file @
6540b1f3
...
@@ -206,24 +206,29 @@ public class SysVinitLaunchScriptIT {
...
@@ -206,24 +206,29 @@ public class SysVinitLaunchScriptIT {
DockerClient
docker
=
createClient
();
DockerClient
docker
=
createClient
();
String
imageId
=
buildImage
(
docker
);
String
imageId
=
buildImage
(
docker
);
String
container
=
createContainer
(
docker
,
imageId
,
script
);
String
container
=
createContainer
(
docker
,
imageId
,
script
);
copyFilesToContainer
(
docker
,
container
,
script
);
try
{
docker
.
startContainerCmd
(
container
).
exec
();
copyFilesToContainer
(
docker
,
container
,
script
);
StringBuilder
output
=
new
StringBuilder
();
docker
.
startContainerCmd
(
container
).
exec
();
AttachContainerResultCallback
resultCallback
=
docker
StringBuilder
output
=
new
StringBuilder
();
.
attachContainerCmd
(
container
).
withStdOut
(
true
).
withStdErr
(
true
)
AttachContainerResultCallback
resultCallback
=
docker
.
withFollowStream
(
true
).
withLogs
(
true
)
.
attachContainerCmd
(
container
).
withStdOut
(
true
).
withStdErr
(
true
)
.
exec
(
new
AttachContainerResultCallback
()
{
.
withFollowStream
(
true
).
withLogs
(
true
)
.
exec
(
new
AttachContainerResultCallback
()
{
@Override
public
void
onNext
(
Frame
item
)
{
@Override
output
.
append
(
new
String
(
item
.
getPayload
()));
public
void
onNext
(
Frame
item
)
{
super
.
onNext
(
item
);
output
.
append
(
new
String
(
item
.
getPayload
()));
}
super
.
onNext
(
item
);
}
});
resultCallback
.
awaitCompletion
(
60
,
TimeUnit
.
SECONDS
).
close
();
});
docker
.
waitContainerCmd
(
container
).
exec
();
resultCallback
.
awaitCompletion
(
60
,
TimeUnit
.
SECONDS
).
close
();
return
output
.
toString
();
docker
.
waitContainerCmd
(
container
).
exec
();
return
output
.
toString
();
}
finally
{
docker
.
removeContainerCmd
(
container
).
exec
();
}
}
}
private
DockerClient
createClient
()
{
private
DockerClient
createClient
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment