github.com/jenspinney/cli@v6.42.1-0.20190207184520-7450c600020e+incompatible/ci/infrastructure/add-pm-alert-and-wait.yml (about)

     1  ---
     2  # Add job to send slack alert and then wait 10 minutes
     3  - type: replace
     4    path: /jobs/0:before
     5    value:
     6      name: alert-pm
     7      plan:
     8      - aggregate:
     9        - get: cf-deployment
    10          trigger: true
    11      - put: slack-alert
    12        params:
    13          channel: '#cli-eng'
    14          text: |
    15            ((pm-slack-handle)) A new version of cf-deployment has been released and ((stack-name)) will be redeploying in 10 minutes! Pause the "deploy" task if you want to halt the redeploy for the time being.
    16      - task: wait-10-minutes
    17        config:
    18          platform: linux
    19          image_resource:
    20            type: docker-image
    21            source:
    22              repository: busybox
    23          run:
    24            path: sh
    25            args:
    26            - -c
    27            - |
    28              sleep 600
    29  
    30  - type: replace
    31    path: /groups/name=create/jobs/-
    32    value: alert-pm
    33  
    34  # Make deploy trigger after the 10 minute wait
    35  - type: replace
    36    path: /jobs/name=deploy/plan/0/aggregate/get=cf-deployment/passed?
    37    value: [alert-pm]
    38  
    39  # Add slack notification resource
    40  - type: replace
    41    path: /resource_types?
    42    value:
    43    - name: slack-notification
    44      type: docker-image
    45      source:
    46        repository: cfcommunity/slack-notification-resource
    47        tag: latest
    48  
    49  - type: replace
    50    path: /resources/-
    51    value:
    52      name: slack-alert
    53      type: slack-notification
    54      source:
    55        url: ((slack-webhook-url))