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
a1fefb15
Commit
a1fefb15
authored
Feb 08, 2016
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5059 from Vedran Pavić
* gh-5059: Remove Docker container after launch script test execution
parents
29c7b936
6540b1f3
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 @
a1fefb15
...
...
@@ -206,24 +206,29 @@ public class SysVinitLaunchScriptIT {
DockerClient
docker
=
createClient
();
String
imageId
=
buildImage
(
docker
);
String
container
=
createContainer
(
docker
,
imageId
,
script
);
copyFilesToContainer
(
docker
,
container
,
script
);
docker
.
startContainerCmd
(
container
).
exec
();
StringBuilder
output
=
new
StringBuilder
();
AttachContainerResultCallback
resultCallback
=
docker
.
attachContainerCmd
(
container
).
withStdOut
(
true
).
withStdErr
(
true
)
.
withFollowStream
(
true
).
withLogs
(
true
)
.
exec
(
new
AttachContainerResultCallback
()
{
@Override
public
void
onNext
(
Frame
item
)
{
output
.
append
(
new
String
(
item
.
getPayload
()));
super
.
onNext
(
item
);
}
});
resultCallback
.
awaitCompletion
(
60
,
TimeUnit
.
SECONDS
).
close
();
docker
.
waitContainerCmd
(
container
).
exec
();
return
output
.
toString
();
try
{
copyFilesToContainer
(
docker
,
container
,
script
);
docker
.
startContainerCmd
(
container
).
exec
();
StringBuilder
output
=
new
StringBuilder
();
AttachContainerResultCallback
resultCallback
=
docker
.
attachContainerCmd
(
container
).
withStdOut
(
true
).
withStdErr
(
true
)
.
withFollowStream
(
true
).
withLogs
(
true
)
.
exec
(
new
AttachContainerResultCallback
()
{
@Override
public
void
onNext
(
Frame
item
)
{
output
.
append
(
new
String
(
item
.
getPayload
()));
super
.
onNext
(
item
);
}
});
resultCallback
.
awaitCompletion
(
60
,
TimeUnit
.
SECONDS
).
close
();
docker
.
waitContainerCmd
(
container
).
exec
();
return
output
.
toString
();
}
finally
{
docker
.
removeContainerCmd
(
container
).
exec
();
}
}
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