Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.36 KB

File metadata and controls

36 lines (28 loc) · 1.36 KB

Run units then deploy application

In this section we combine three ideas into a more advanced job:

  1. trigger the job anytime the application repo is changed
  2. run the internal unit tests of the application
  3. if successful, deploy the web application immediately

test-deploy

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