From 925c3ec8355710778ced7cc21bf0dcef2b93b937 Mon Sep 17 00:00:00 2001 From: Josh Hill Date: Mon, 7 Jan 2019 14:47:36 +0000 Subject: [PATCH 1/3] Reorder resources in PKS sample pipeline [#162158567] Signed-off-by: Jake Klein --- examples/pks-pipeline.yml | 76 +++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/examples/pks-pipeline.yml b/examples/pks-pipeline.yml index 1a3ebb5..6b07d68 100644 --- a/examples/pks-pipeline.yml +++ b/examples/pks-pipeline.yml @@ -13,6 +13,44 @@ s3_credentials: &s3_credentials secret_access_key: ((storage-secret-access-key)) endpoint: ((storage-endpoint)) +resource_types: +- name: pivnet + type: docker-image + source: + repository: pivotalcf/pivnet-resource + tag: latest-final + +resources: +- name: bbr-pipeline-tasks-repo + type: git + source: + uri: https://github.com/pivotal-cf/bbr-pcf-pipeline-tasks.git + branch: master + +- name: bbr-release + type: pivnet + source: + api_token: ((pivnet-api-token)) + product_slug: p-bosh-backup-and-restore + +- name: om-backup-bucket + type: s3 + source: + <<: *s3_credentials + versioned_file: installation.zip + +- name: director-backup-bucket + type: s3 + source: + <<: *s3_credentials + versioned_file: director-backup.tar + +- name: pks-backup-bucket + type: s3 + source: + <<: *s3_credentials + versioned_file: pks-backup.tar + jobs: - name: export-om-installation serial: true @@ -145,41 +183,3 @@ jobs: file: bbr-pipeline-tasks-repo/tasks/unlock-pks/task.yml params: <<: *opsman_credentials - -resource_types: -- name: pivnet - type: docker-image - source: - repository: pivotalcf/pivnet-resource - tag: latest-final - -resources: -- name: bbr-pipeline-tasks-repo - type: git - source: - uri: https://github.com/pivotal-cf/bbr-pcf-pipeline-tasks.git - branch: master - -- name: bbr-release - type: pivnet - source: - api_token: ((pivnet-api-token)) - product_slug: p-bosh-backup-and-restore - -- name: om-backup-bucket - type: s3 - source: - <<: *s3_credentials - versioned_file: installation.zip - -- name: director-backup-bucket - type: s3 - source: - <<: *s3_credentials - versioned_file: director-backup.tar - -- name: pks-backup-bucket - type: s3 - source: - <<: *s3_credentials - versioned_file: pks-backup.tar From f88ec0c6a57f13e2765d54e75715496fd642f0a1 Mon Sep 17 00:00:00 2001 From: Josh Hill Date: Mon, 7 Jan 2019 16:11:18 +0000 Subject: [PATCH 2/3] Use git private key to avoid GitHub rate limit [#162158567] Signed-off-by: Jake Klein --- examples/pks-pipeline.yml | 3 ++- examples/pks-secrets.yml | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/pks-pipeline.yml b/examples/pks-pipeline.yml index 6b07d68..1367e76 100644 --- a/examples/pks-pipeline.yml +++ b/examples/pks-pipeline.yml @@ -24,7 +24,8 @@ resources: - name: bbr-pipeline-tasks-repo type: git source: - uri: https://github.com/pivotal-cf/bbr-pcf-pipeline-tasks.git + uri: git@github.com:pivotal-cf/bbr-pcf-pipeline-tasks.git + private_key: ((git-private-key)) branch: master - name: bbr-release diff --git a/examples/pks-secrets.yml b/examples/pks-secrets.yml index 4d07854..0f69e91 100644 --- a/examples/pks-secrets.yml +++ b/examples/pks-secrets.yml @@ -1,4 +1,8 @@ --- +git-private-key: | # GitHub user private key to pull bbr-pcf-pipeline-tasks repo + -----BEGIN EXAMPLE PRIVATE KEY----- + ... + -----END EXAMPLE PRIVATE KEY----- pivnet-api-token: example-pivnet-token # Ops Manager credentials From 41d23b5de1933888a5265f99bb291896c068d919 Mon Sep 17 00:00:00 2001 From: Jake Klein Date: Mon, 7 Jan 2019 16:12:09 +0000 Subject: [PATCH 3/3] Unify pks backup tasks into a single job [#162158567] Signed-off-by: Josh Hill --- examples/pks-pipeline.yml | 121 ++++++++++---------------------------- 1 file changed, 31 insertions(+), 90 deletions(-) diff --git a/examples/pks-pipeline.yml b/examples/pks-pipeline.yml index 1367e76..3b9de6b 100644 --- a/examples/pks-pipeline.yml +++ b/examples/pks-pipeline.yml @@ -70,7 +70,7 @@ jobs: params: file: om-installation/installation.zip -- name: lock-pks +- name: bbr-backup-pks-foundation serial: true plan: - aggregate: @@ -80,107 +80,48 @@ jobs: file: bbr-pipeline-tasks-repo/tasks/lock-pks/task.yml params: <<: *opsman_credentials - -- name: bbr-backup-director - serial: true - plan: - - aggregate: - - get: bbr-release - passed: [lock-pks] - - get: bbr-pipeline-tasks-repo - passed: [lock-pks] - task: extract-binary file: bbr-pipeline-tasks-repo/tasks/extract-bbr-binary/task.yml - - task: bbr-backup-director - privileged: true - file: bbr-pipeline-tasks-repo/tasks/bbr-backup-director/task.yml - params: - <<: *opsman_credentials - on_failure: - aggregate: - - task: bbr-cleanup-director + - aggregate: + - task: bbr-backup-director + file: bbr-pipeline-tasks-repo/tasks/bbr-backup-director/task.yml + params: + <<: *opsman_credentials + on_failure: + task: bbr-cleanup-director file: bbr-pipeline-tasks-repo/tasks/bbr-cleanup-director/task.yml params: <<: *opsman_credentials - - task: unlock-pks - file: bbr-pipeline-tasks-repo/tasks/unlock-pks/task.yml - params: - <<: *opsman_credentials - - put: director-backup-bucket - params: - file: director-backup-artifact/director-backup.tar - -- name: bbr-backup-pks - serial: true - plan: - - aggregate: - - get: bbr-release - passed: [lock-pks] - - get: bbr-pipeline-tasks-repo - passed: [lock-pks] - - task: extract-binary - file: bbr-pipeline-tasks-repo/tasks/extract-bbr-binary/task.yml - - task: bbr-backup-pks - file: bbr-pipeline-tasks-repo/tasks/bbr-backup-pks/task.yml - params: - <<: *opsman_credentials - on_failure: - aggregate: - - task: bbr-cleanup-pks + - task: bbr-backup-pks + file: bbr-pipeline-tasks-repo/tasks/bbr-backup-pks/task.yml + params: + <<: *opsman_credentials + on_failure: + task: bbr-cleanup-pks file: bbr-pipeline-tasks-repo/tasks/bbr-cleanup-pks/task.yml params: <<: *opsman_credentials - - task: unlock-pks - file: bbr-pipeline-tasks-repo/tasks/unlock-pks/task.yml - params: - <<: *opsman_credentials - - put: pks-backup-bucket - params: - file: pks-backup-artifact/pks-backup.tar - -- name: bbr-backup-pks-clusters - serial: true - plan: - - aggregate: - - get: bbr-release - passed: [lock-pks] - - get: bbr-pipeline-tasks-repo - passed: [lock-pks] - - task: extract-binary - file: bbr-pipeline-tasks-repo/tasks/extract-bbr-binary/task.yml - - task: bbr-backup-pks-clusters - file: bbr-pipeline-tasks-repo/tasks/bbr-backup-pks-clusters/task.yml - params: - <<: *opsman_credentials - on_failure: - aggregate: - - task: unlock-pks - file: bbr-pipeline-tasks-repo/tasks/unlock-pks/task.yml - params: - <<: *opsman_credentials - - task: bbr-cleanup-pks-clusters + - task: bbr-backup-pks-clusters + file: bbr-pipeline-tasks-repo/tasks/bbr-backup-pks-clusters/task.yml + params: + <<: *opsman_credentials + on_failure: + task: bbr-cleanup-pks-clusters file: bbr-pipeline-tasks-repo/tasks/bbr-cleanup-pks-clusters/task.yml params: <<: *opsman_credentials - - put: pks-backup-bucket - params: - file: pks-clusters-backup-artifact/pks-clusters-backup.tar - -- name: unlock-pks - serial: true - plan: - aggregate: - - get: bbr-release - passed: - - bbr-backup-director - - bbr-backup-pks - - bbr-backup-pks-clusters - - get: bbr-pipeline-tasks-repo - passed: - - bbr-backup-director - - bbr-backup-pks - - bbr-backup-pks-clusters - - task: unlock-pks + - put: director-backup-bucket + params: + file: director-backup-artifact/director-backup.tar + - put: pks-backup-bucket + params: + file: pks-backup-artifact/pks-backup.tar + - put: pks-backup-bucket + params: + file: pks-clusters-backup-artifact/pks-clusters-backup.tar + ensure: + task: unlock-pks file: bbr-pipeline-tasks-repo/tasks/unlock-pks/task.yml params: <<: *opsman_credentials