Skip to content

Commit

Permalink
Add wait time to allow API activation
Browse files Browse the repository at this point in the history
  • Loading branch information
gleichda committed May 12, 2022
1 parent b07afd7 commit 8a90008
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions build/int.cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,23 @@ steps:
- 'TF_VAR_org_id=$_ORG_ID'
- 'TF_VAR_folder_id=$_FOLDER_ID'
- 'TF_VAR_billing_account=$_BILLING_ACCOUNT'

# Sometimes API activation can be bit flaky therefor ensure that at least 3 mins (180s) are passed between
# prepare_environment and the first terraform apply (init-all runs parallel to reduce waste of time)
- id: wait for api activation
waitFor:
- prepare
name: 'alpine:latest'
args: ['sleep', '180']

- id: init-all
waitFor:
- prepare
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run all --stage init --verbose']

- id: apply mssql-ha-local
waitFor:
- init-all
waitFor: [" init-all", "wait for api activation"]
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestMsSqlHaModule --stage apply --verbose']
- id: verify mssql-ha-local
Expand All @@ -44,8 +52,7 @@ steps:
args: ['/bin/bash', '-c', 'cft test run TestMsSqlHaModule --stage teardown --verbose']

- id: apply mssql-public-local
waitFor:
- init-all
waitFor: [" init-all", "wait for api activation"]
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestMsSqlPublicModule --stage apply --verbose']
- id: verify mssql-public-local
Expand All @@ -60,8 +67,7 @@ steps:
args: ['/bin/bash', '-c', 'cft test run TestMsSqlPublicModule --stage teardown --verbose']

- id: apply mysql-ha-local
waitFor:
- init-all
waitFor: [" init-all", "wait for api activation"]
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestMySqlHaModule --stage apply --verbose']
- id: verify mysql-ha-local
Expand All @@ -76,8 +82,7 @@ steps:
args: ['/bin/bash', '-c', 'cft test run TestMySqlHaModule --stage teardown --verbose']

- id: apply mysql-private-local
waitFor:
- init-all
waitFor: [" init-all", "wait for api activation"]
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestMySqlPrivateModule --stage apply --verbose']
- id: verify mysql-private-local
Expand All @@ -92,8 +97,7 @@ steps:
args: ['/bin/bash', '-c', 'cft test run TestMySqlPrivateModule --stage teardown --verbose']

- id: apply mysql-public-local
waitFor:
- init-all
waitFor: [" init-all", "wait for api activation"]
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestMySqlPublicModule --stage apply --verbose']
- id: verify mysql-public-local
Expand All @@ -108,8 +112,7 @@ steps:
args: ['/bin/bash', '-c', 'cft test run TestMySqlPublicModule --stage teardown --verbose']

- id: apply postgresql-ha-local
waitFor:
- init-all
waitFor: [" init-all", "wait for api activation"]
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestPostgreSqlHaModule --stage apply --verbose']
- id: verify postgresql-ha-local
Expand All @@ -124,8 +127,7 @@ steps:
args: ['/bin/bash', '-c', 'cft test run TestPostgreSqlHaModule --stage teardown --verbose']

- id: apply postgresql-public-local
waitFor:
- init-all
waitFor: [" init-all", "wait for api activation"]
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestPostgreSqlPublicModule --stage apply --verbose']
- id: verify postgresql-public-local
Expand All @@ -140,8 +142,7 @@ steps:
args: ['/bin/bash', '-c', 'cft test run TestPostgreSqlPublicModule --stage teardown --verbose']

- id: apply postgresql-public-iam-local
waitFor:
- init-all
waitFor: [" init-all", "wait for api activation"]
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestPostgreSqlPublicIamModule --stage apply --verbose']
- id: verify postgresql-public-iam-local
Expand All @@ -156,8 +157,7 @@ steps:
args: ['/bin/bash', '-c', 'cft test run TestPostgreSqlPublicIamModule --stage teardown --verbose']

- id: apply mysql-backup-local
waitFor:
- init-all
waitFor: [" init-all", "wait for api activation"]
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestMySqlBackupModuleCreateServiceAccount --stage apply --verbose']
- id: verify mysql-backup-local
Expand All @@ -172,8 +172,7 @@ steps:
args: ['/bin/bash', '-c', 'cft test run TestMySqlBackupModuleCreateServiceAccount --stage teardown --verbose']

- id: apply postgresql-backup-local
waitFor:
- init-all
waitFor: [" init-all", "wait for api activation"]
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'cft test run TestPostgresqlBackupModuleProvidedServiceAccount --stage apply --verbose']
- id: verify postgresql-backup-local
Expand Down

0 comments on commit 8a90008

Please sign in to comment.