concourse-tutorial icon indicating copy to clipboard operation
concourse-tutorial copied to clipboard

How to use "ensure" step to release locks of 2 pool resource?

Open lxiaopei opened this issue 6 years ago • 0 comments

Hi,

I have the below sample pipeline. in the pipeline , I used 2 pool resource, after the task , I want to make sure that the locks are both got released to the pool. how can I do that? seems I cannot use 2 "ensure" steps.

- name: pool1
  type: pool
  source:
    uri: ((pool1_repo))
    branch: master
    pool: pool1
    private_key: ((private-key))
- name: pool2
  type: pool
  source:
    uri: ((pool2_repo))
    branch: master
    pool: pool2
    private_key: ((private-key))
jobs:
- name: deploy
  serial: true
  plan:
  - aggregate:
    - get: test
    - put: pool1-lock
      resource: pool1
      params: { acquire: true}
 - put: pool2-lock
      resource: pool2
      params: { acquire: true}

  - do:
    - task: deploy-task
      file: test/tasks/task.yml

    ensure:
      put: pool1-lock
      resource: pool1
      params: { release: pool1-lock }


lxiaopei avatar Nov 27 '19 10:11 lxiaopei