github.com/cloudfoundry-community/cloudfoundry-cli@v6.44.1-0.20240130060226-cda5ed8e89a5+incompatible/ci/cli-dev-bosh-lite/pipeline.yml (about) 1 resource_types: 2 - name: slack-notification 3 type: docker-image 4 source: 5 repository: cfcommunity/slack-notification-resource 6 tag: latest 7 8 - name: terraform 9 type: docker-image 10 source: 11 repository: ljfranklin/terraform-resource 12 tag: beta-backend 13 - name: bosh-deployment 14 type: docker-image 15 source: 16 repository: cloudfoundry/bosh-deployment-resource 17 - name: cron-resource 18 type: docker-image 19 source: 20 repository: cftoolsmiths/cron-test 21 22 resources: 23 - name: terraform 24 type: terraform 25 source: 26 backend_type: gcs 27 backend_config: 28 bucket: ((bosh-lite-storage-bucket)) 29 prefix: terraform_state_files/ 30 region: ((bosh-lite-region)) 31 credentials: ((bosh-lite-gcp-json-key)) 32 - name: cli 33 type: git 34 source: 35 branch: master 36 uri: git@github.com:cloudfoundry/cli.git 37 private_key: ((bosh-lite-pools-github-private-key)) 38 - name: capi-ci 39 type: git 40 source: 41 branch: master 42 uri: git@github.com:cloudfoundry/capi-ci.git 43 private_key: ((bosh-lite-pools-github-private-key)) 44 - name: bosh-deployment 45 type: git 46 source: 47 branch: master 48 uri: git@github.com:cloudfoundry/bosh-deployment.git 49 private_key: ((bosh-lite-pools-github-private-key)) 50 - name: ready-pool 51 type: pool 52 source: 53 branch: master 54 uri: ((env-pool-repo)) 55 pool: bosh-lites 56 private_key: ((bosh-lite-pools-github-private-key)) 57 - name: deleting-pool 58 type: pool 59 source: 60 branch: master 61 uri: ((env-pool-repo)) 62 pool: bosh-lites-to-be-deleted 63 private_key: ((bosh-lite-pools-github-private-key)) 64 - name: building-pool 65 type: pool 66 source: 67 branch: master 68 uri: ((env-pool-repo)) 69 pool: building-bosh-lites 70 private_key: ((bosh-lite-pools-github-private-key)) 71 - name: pool-repo 72 type: git 73 source: 74 branch: master 75 uri: ((env-pool-repo)) 76 private_key: ((bosh-lite-pools-github-private-key)) 77 - name: create-bosh-lite-trigger 78 type: git 79 source: 80 branch: master 81 uri: ((env-pool-repo)) 82 private_key: ((bosh-lite-pools-github-private-key)) 83 paths: 84 - .trigger-bosh-lites-create # updated by check-pool-size 85 - name: destroy-bosh-lite-trigger 86 type: git 87 source: 88 branch: master 89 uri: ((env-pool-repo)) 90 private_key: ((bosh-lite-pools-github-private-key)) 91 paths: 92 - .trigger-bosh-lites-destroy # updated by unclaim_bosh_lite alias 93 - name: cf-deployment 94 type: git 95 source: 96 uri: git@github.com:cloudfoundry/cf-deployment.git 97 private_key: ((bosh-lite-pools-github-private-key)) 98 tag_filter: v8.* 99 - name: cf-deploy 100 type: bosh-deployment 101 source: 102 skip_check: true 103 - name: 5m 104 type: time 105 source: 106 interval: 5m 107 - name: slack-alert 108 type: slack-notification 109 source: 110 url: ((slack-webhook-url)) 111 112 jobs: 113 - name: create-bosh-lite 114 plan: 115 - aggregate: 116 - get: capi-ci 117 - get: bosh-deployment 118 - get: cf-deployment 119 - get: cli 120 - get: create-bosh-lite-trigger 121 trigger: true 122 - task: generate-fake-env-for-building-pool 123 file: capi-ci/ci/bosh-lite/generate-fake-env-for-building-pool.yml 124 - put: building-pool 125 params: 126 add_claimed: fake-placeholder-env/ 127 - put: terraform 128 params: 129 generate_random_name: true 130 delete_on_failure: true 131 terraform_source: capi-ci/terraform/bosh-lite/ 132 vars: 133 project_id: ((bosh-lite-project-id)) 134 json_key: ((bosh-lite-gcp-json-key)) 135 dns_project_id: ((bosh-lite-project-id)) 136 dns_json_key: ((bosh-lite-gcp-json-key)) 137 system_domain_suffix: ((bosh-lite-system-domain-suffix)) 138 dns_zone_name: ((bosh-lite-dns-zone-name)) 139 region: ((bosh-lite-region)) 140 - do: 141 - task: create-bosh-lite 142 file: capi-ci/ci/bosh-lite/create-bosh-lite.yml 143 params: 144 GCP_JSON_KEY: ((bosh-lite-gcp-json-key)) 145 GCP_INSTANCE_TYPE: n1-standard-4 146 - do: 147 - task: create-env-vars-file 148 file: capi-ci/ci/bosh-lite/create-env-vars-file.yml 149 - task: upload-cf-assets 150 file: capi-ci/ci/bosh-lite/upload-cf-assets.yml 151 - task: write-bosh-target-file 152 file: capi-ci/ci/bosh-lite/write-bosh-target-file.yml 153 - put: cf-deploy 154 params: 155 source_file: bosh-target/target.yml 156 manifest: cf-deployment/cf-deployment.yml 157 vars_files: 158 - bosh-target/vars.yml 159 ops_files: 160 - capi-ci/cf-deployment-operations/skip-cert-verify.yml 161 - capi-ci/cf-deployment-operations/use-latest-stemcell.yml 162 - cf-deployment/operations/bosh-lite.yml 163 - cf-deployment/operations/use-compiled-releases.yml 164 - cf-deployment/operations/test/add-persistent-isolation-segment-diego-cell.yml 165 - cf-deployment/operations/test/add-persistent-isolation-segment-diego-cell-bosh-lite.yml 166 - capi-ci/cf-deployment-operations/seed-credhub-asg.yml 167 - cli/ci/infrastructure/operations/default-app-memory.yml 168 - cli/ci/infrastructure/operations/add-oidc-provider.yml 169 - cli/ci/infrastructure/operations/add-uaa-client-cf-custom.yml 170 - cli/ci/infrastructure/operations/give-cf-admin-clients-read-scope.yml 171 - task: upload-to-gcs 172 file: capi-ci/ci/gcs/upload-to-gcs.yml 173 input_mapping: 174 environment: terraform 175 source-directory: director-state 176 params: 177 GCP_JSON_KEY: ((bosh-lite-gcp-json-key)) 178 GCP_BUCKET: ((bosh-lite-storage-bucket)) 179 GCP_PATH: director-state 180 USE_ENV_NAMED_SUBDIR: true 181 - put: ready-pool 182 params: 183 add: bosh-lite-env-info/ 184 - put: building-pool 185 params: 186 remove: fake-placeholder-env/ 187 on_failure: 188 aggregate: 189 - task: delete-bosh-lite 190 file: capi-ci/ci/bosh-lite/delete-bosh-lite.yml 191 - put: slack-alert 192 params: 193 channel: '#cli-eng' 194 text: | 195 Creating a bosh-lite failed :( 196 ``` 197 Do the following tasks: 198 1.Make sure the bosh-lite is deleted and resources are cleaned up. 199 2.Remove the corresponding sha file from building-bosh-lites pool. 200 3.Retrigger the create-bosh-lite task in the pipeline. 201 Link: $ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME 202 https://bit.ly/2S5aIov 203 ``` 204 on_failure: 205 aggregate: 206 - put: terraform 207 params: 208 action: destroy 209 env_name_file: terraform/name 210 terraform_source: capi-ci/terraform/bosh-lite/ 211 vars: 212 project_id: ((bosh-lite-project-id)) 213 json_key: ((bosh-lite-gcp-json-key)) 214 dns_project_id: ((bosh-lite-project-id)) 215 dns_json_key: ((bosh-lite-gcp-json-key)) 216 system_domain_suffix: ((bosh-lite-system-domain-suffix)) 217 dns_zone_name: ((bosh-lite-dns-zone-name)) 218 region: ((bosh-lite-region)) 219 get_params: 220 action: destroy 221 222 - name: delete-bosh-lite 223 plan: 224 - aggregate: 225 - get: destroy-bosh-lite-trigger 226 version: every 227 trigger: true 228 - get: capi-ci 229 - get: bosh-deployment 230 - put: deleting-pool 231 params: 232 acquire: true 233 - do: 234 - task: download-from-gcs 235 file: capi-ci/ci/gcs/download-from-gcs.yml 236 input_mapping: 237 environment: deleting-pool 238 output_mapping: 239 destination-directory: director-state 240 params: 241 GCP_JSON_KEY: ((bosh-lite-gcp-json-key)) 242 GCP_BUCKET: ((bosh-lite-storage-bucket)) 243 GCP_PATH: director-state 244 USE_ENV_NAMED_SUBDIR: true 245 - task: delete-bosh-lite 246 file: capi-ci/ci/bosh-lite/delete-bosh-lite.yml 247 - put: terraform 248 params: 249 action: destroy 250 env_name_file: deleting-pool/name 251 terraform_source: capi-ci/terraform/bosh-lite/ 252 vars: 253 project_id: ((bosh-lite-project-id)) 254 json_key: ((bosh-lite-gcp-json-key)) 255 dns_project_id: ((bosh-lite-project-id)) 256 dns_json_key: ((bosh-lite-gcp-json-key)) 257 system_domain_suffix: ((bosh-lite-system-domain-suffix)) 258 dns_zone_name: ((bosh-lite-dns-zone-name)) 259 region: ((bosh-lite-region)) 260 get_params: 261 action: destroy 262 - task: delete-from-gcs 263 file: capi-ci/ci/gcs/delete-from-gcs.yml 264 input_mapping: 265 environment: deleting-pool 266 params: 267 GCP_JSON_KEY: ((bosh-lite-gcp-json-key)) 268 GCP_BUCKET: ((bosh-lite-storage-bucket)) 269 GCP_PATH: director-state 270 USE_ENV_NAMED_SUBDIR: true 271 - put: deleting-pool 272 params: 273 remove: deleting-pool/ 274 275 - name: check-pool-size 276 build_logs_to_retain: 100 277 plan: 278 - aggregate: 279 - get: capi-ci 280 - get: pool-repo 281 - get: 5m 282 trigger: true 283 - task: check-pool-size 284 file: capi-ci/ci/bosh-lite/check-pool-size.yml 285 input_mapping: 286 env-pool: pool-repo 287 params: 288 MIN_UNCLAIMED_COUNT: 3 289 GIT_USERNAME: ((git-username)) 290 GIT_EMAIL: ((git-email)) 291 - put: pool-repo 292 params: 293 repository: updated-env-pool 294 rebase: true