In this section we combine three ideas into a more advanced job:
- trigger the job anytime the application repo is changed
- run the internal unit tests of the application
- if successful, deploy the web application immediately
We have previously seen steps 1 and 2 in section 10 and step 3 in the previous section 15. We are now combining them into one pipeline.
To the deploy-app
pipeline with the additional trigger and unit test steps:
cd ../16_run_tests_before_deploy
fly set-pipeline --target tutorial --config pipeline.yml --pipeline deploy-app --non-interactive --load-vars-from ../credentials.yml
For convenience to us both, we're reusing the same task files from section 10 to run the tests for the :
- name: job-deploy-app
public: true
serial: true
plan:
- get: resource-tutorial
- get: resource-app
trigger: true
- task: web-app-tests
file: resource-tutorial/10_job_inputs/task_run_tests.yml
- put: resource-deploy-web-app
params:
manifest: resource-app/manifest.yml
path: resource-app