Skip to content

Commit

Permalink
Starting and stopping container as part of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Van Fleet committed Aug 24, 2016
1 parent 6f1f28d commit 3ab869f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,17 @@ node {
sh "rm -f ./debug"
handleError(message)
}
stage 'Start container'

sh 'bin/ci-run.sh'

stage 'Tests'

sh 'bin/test.sh'
// should build a finally construct here
stage 'Stop container'

sh 'bin/ci-stop.sh'

stage 'Push'

Expand Down
6 changes: 6 additions & 0 deletions bin/ci-run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# This file will run a container in the background
source common.bash .

docker run -d --name=$imagename -p 80:80 -p 443:443 $maintainer/$imagename
8 changes: 8 additions & 0 deletions bin/ci-stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

# This file will run a container in the background
source common.bash .

echo "Cleaning up Docker image($maintainer/$imagename)"
docker stop $imagename >> /dev/null
docker rm $imagename

0 comments on commit 3ab869f

Please sign in to comment.