August 2017
Intermediate to advanced
332 pages
9h 16m
English
As the last step, we can add the acceptance test execution to the pipeline. Let's replace the last three stages in Jenkinsfile with one new Acceptance test stage:
stage("Acceptance test") { steps { sh "docker-compose -f docker-compose.yml -f acceptance/docker-compose-acceptance.yml build test" sh "docker-compose -f docker-compose.yml -f acceptance/docker-compose-acceptance.yml -p acceptance up -d" sh 'test $(docker wait acceptance_test_1) -eq 0' }}
This time, we first build the test service. There is no need to build the calculator image; it's already done by the previous stages. In the end, we should clean up the environment:
post { always { sh "docker-compose -f docker-compose.yml -f acceptance/docker-compose-acceptance.yml ...Read now
Unlock full access