diff --git a/build/int.cloudbuild.yaml b/build/int.cloudbuild.yaml index f8f09c1a..002bef56 100644 --- a/build/int.cloudbuild.yaml +++ b/build/int.cloudbuild.yaml @@ -21,75 +21,206 @@ steps: - 'TF_VAR_org_id=$_ORG_ID' - 'TF_VAR_folder_id=$_FOLDER_ID' - 'TF_VAR_billing_account=$_BILLING_ACCOUNT' -- id: create + +# verify additive-local with 2 roles +- id: create additive-local 2 roles + waitFor: + - prepare name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' - args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create'] -- id: converge + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create additive-local'] + env: + - 'TF_VAR_roles=2' +- id: converge additive-local 2 roles + waitFor: + - create additive-local 2 roles name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' - args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge'] -- id: verify + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge additive-local'] + env: + - 'TF_VAR_roles=2' +- id: verify additive-local 2 roles + waitFor: + - converge additive-local 2 roles name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' - args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify'] - -# Test how the module behaves after configuration updates -# Initial roles amount is 2 + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify additive-local'] + env: + - 'TF_VAR_roles=2' -# Change to 1 role and test -- id: converge-1-role +# scale additive-local to 1 role and reverify +- id: converge additive-local 1 role + waitFor: + - verify additive-local 2 roles name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' - args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge'] + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge additive-local'] env: - 'TF_VAR_roles=1' -- id: verify-1-role +- id: verify additive-local 1 role + waitFor: + - converge additive-local 1 role name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' - args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify'] + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify additive-local'] + env: + - 'TF_VAR_roles=1' -# Change to 2 roles and test -- id: converge-2-roles +# scale additive-local back to 2 roles and reverify +- id: converge additive-local 2 roles again + waitFor: + - verify additive-local 1 role + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge additive-local'] + env: + - 'TF_VAR_roles=2' +- id: verify additive-local 2 roles again + waitFor: + - converge additive-local 2 roles again name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' - args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge'] + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify additive-local'] env: - 'TF_VAR_roles=2' -- id: verify-2-roles +- id: destroy additive-local + waitFor: + - verify additive-local 2 roles again name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' - args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify'] + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy additive-local'] + env: + - 'TF_VAR_roles=2' + +# verify authoritative-local with 2 roles +- id: create authoritative-local 2 roles + waitFor: + - prepare + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create authoritative-local'] + env: + - 'TF_VAR_roles=2' +- id: converge authoritative-local 2 roles + waitFor: + - create authoritative-local 2 roles + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge authoritative-local'] + env: + - 'TF_VAR_roles=2' +- id: verify authoritative-local 2 roles + waitFor: + - converge authoritative-local 2 roles + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify authoritative-local'] + env: + - 'TF_VAR_roles=2' + +# scale authoritative-local to 1 role and reverify +- id: converge authoritative-local 1 role + waitFor: + - verify authoritative-local 2 roles + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge authoritative-local'] + env: + - 'TF_VAR_roles=1' +- id: verify authoritative-local 1 role + waitFor: + - converge authoritative-local 1 role + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify authoritative-local'] + env: + - 'TF_VAR_roles=1' -# Do more extensive configuration update testing for the `static-and-dynamic` suite. +# scale authoritative-local back to 2 roles and reverify +- id: converge authoritative-local 2 roles again + waitFor: + - verify authoritative-local 1 role + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge authoritative-local'] + env: + - 'TF_VAR_roles=2' +- id: verify authoritative-local 2 roles again + waitFor: + - converge authoritative-local 2 roles again + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify authoritative-local'] + env: + - 'TF_VAR_roles=2' +- id: destroy authoritative-local + waitFor: + - verify authoritative-local 2 roles again + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy authoritative-local'] env: + - 'TF_VAR_roles=2' -# Change static-and-dynamic to 3 roles and test -- id: converge-static-and-dynamic-3-roles +# verify static-and-dynamic with 2 roles +- id: create static-and-dynamic 2 roles + waitFor: + - prepare + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create static-and-dynamic'] + env: + - 'TF_VAR_roles=2' +- id: converge static-and-dynamic 2 roles + waitFor: + - create static-and-dynamic 2 roles name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge static-and-dynamic'] env: - - 'TF_VAR_roles=3' -- id: verify-static-and-dynamic-3-roles + - 'TF_VAR_roles=2' +- id: verify static-and-dynamic 2 roles + waitFor: + - converge static-and-dynamic 2 roles name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify static-and-dynamic'] + env: + - 'TF_VAR_roles=2' -# Change static-and-dynamic to 1 role and test -- id: converge-static-and-dynamic-1-role +# scale static-and-dynamic to 1 role and reverify +- id: converge static-and-dynamic 1 role + waitFor: + - verify static-and-dynamic 2 roles name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge static-and-dynamic'] env: - 'TF_VAR_roles=1' -- id: verify-static-and-dynamic-1-role +- id: verify static-and-dynamic 1 role + waitFor: + - converge static-and-dynamic 1 role name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify static-and-dynamic'] + env: + - 'TF_VAR_roles=1' -# Change static-and-dynamic to 2 roles and test -- id: converge-static-and-dynamic-2-roles +# scale authoritative-local to 3 roles and reverify +- id: converge authoritative-local 3 roles + waitFor: + - verify authoritative-local 1 role + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge authoritative-local'] + env: + - 'TF_VAR_roles=3' +- id: verify authoritative-local 3 roles + waitFor: + - converge authoritative-local 3 roles + name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify authoritative-local'] + env: + - 'TF_VAR_roles=3' + +# scale static-and-dynamic back to 2 roles and reverify +- id: converge static-and-dynamic 2 roles again + waitFor: + - verify static-and-dynamic 3 roles name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge static-and-dynamic'] env: - 'TF_VAR_roles=2' -- id: verify-static-and-dynamic-2-roles +- id: verify static-and-dynamic 2 roles again + waitFor: + - converge static-and-dynamic 2 roles again name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify static-and-dynamic'] - -# Destroy all suites -- id: destroy + env: + - 'TF_VAR_roles=2' +- id: destroy static-and-dynamic-local name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS' - args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy'] + args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy static-and-dynamic-local'] + env: + - 'TF_VAR_roles=2' + tags: - 'ci' - 'integration'