diff --git a/libs/getsentry.libsonnet b/libs/getsentry.libsonnet index 17aa145..7f580d4 100644 --- a/libs/getsentry.libsonnet +++ b/libs/getsentry.libsonnet @@ -3,7 +3,7 @@ */ { - group_order: ['s4s2', 'de', 'us', 'control', 'prod-control', 'snty-tools', 'st'], + group_order: ['s4s2', 'de', 'us', 'us2', 'control', 'prod-control', 'snty-tools', 'st'], // Empty for now — add future test groups here test_group_order: [], // These groupings consist of user facing deployments @@ -11,6 +11,7 @@ s4s2: ['s4s2'], de: ['de'], us: ['us'], + us2: ['us2'], control: ['control'], 'prod-control': ['prod-control'], 'snty-tools': ['snty-tools'], diff --git a/test/testdata/fixtures/pipedream/single-region-multi-cell.jsonnet b/test/testdata/fixtures/pipedream/single-region-multi-cell.jsonnet index e4313a2..e2d5daa 100644 --- a/test/testdata/fixtures/pipedream/single-region-multi-cell.jsonnet +++ b/test/testdata/fixtures/pipedream/single-region-multi-cell.jsonnet @@ -10,7 +10,7 @@ local pipedream = import '../../../../libs/pipedream.libsonnet'; local pipedream_config = { name: 'example', auto_deploy: true, - exclude_regions: ['us', 's4s2', 'customer-1', 'customer-2', 'customer-4', 'customer-7'], + exclude_regions: ['us', 'us2', 's4s2', 'customer-1', 'customer-2', 'customer-4', 'customer-7'], }; local cells_for(region) = { diff --git a/test/testdata/goldens/getsentry/groups.jsonnet_output-files.golden b/test/testdata/goldens/getsentry/groups.jsonnet_output-files.golden index cea395d..7cf0fec 100644 --- a/test/testdata/goldens/getsentry/groups.jsonnet_output-files.golden +++ b/test/testdata/goldens/getsentry/groups.jsonnet_output-files.golden @@ -23,12 +23,16 @@ ], "us": [ "us" + ], + "us2": [ + "us2" ] }, "group_order": [ "s4s2", "de", "us", + "us2", "control", "prod-control", "snty-tools", diff --git a/test/testdata/goldens/pipedream/basic-autodeploy.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/basic-autodeploy.jsonnet_output-files.golden index 1634c66..eff30de 100644 --- a/test/testdata/goldens/pipedream/basic-autodeploy.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/basic-autodeploy.jsonnet_output-files.golden @@ -109,14 +109,14 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -238,5 +238,60 @@ ] } } + }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } } } diff --git a/test/testdata/goldens/pipedream/basic-autodeploy.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/basic-autodeploy.jsonnet_single-file.golden index 83e2a19..6067d97 100644 --- a/test/testdata/goldens/pipedream/basic-autodeploy.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/basic-autodeploy.jsonnet_single-file.golden @@ -98,14 +98,14 @@ ] }, "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -220,6 +220,56 @@ } } ] + }, + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] } } } diff --git a/test/testdata/goldens/pipedream/basic-manual.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/basic-manual.jsonnet_output-files.golden index d09352f..f2c67df 100644 --- a/test/testdata/goldens/pipedream/basic-manual.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/basic-manual.jsonnet_output-files.golden @@ -113,14 +113,14 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -243,6 +243,61 @@ } } }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } + }, "deploy-example.yaml": { "format_version": 10, "pipelines": { diff --git a/test/testdata/goldens/pipedream/basic-manual.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/basic-manual.jsonnet_single-file.golden index 220fed7..b6a47cc 100644 --- a/test/testdata/goldens/pipedream/basic-manual.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/basic-manual.jsonnet_single-file.golden @@ -135,14 +135,14 @@ ] }, "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -257,6 +257,56 @@ } } ] + }, + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] } } } diff --git a/test/testdata/goldens/pipedream/different-stages-per-region.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/different-stages-per-region.jsonnet_output-files.golden index 3e7ee06..0657012 100644 --- a/test/testdata/goldens/pipedream/different-stages-per-region.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/different-stages-per-region.jsonnet_output-files.golden @@ -151,14 +151,14 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "init_repo": { @@ -358,5 +358,81 @@ ] } } + }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "init_repo": { + "branch": "main", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "tasks": [ + { + "exec": { + "arguments": [ + "deploy us2" + ], + "command": "echo" + } + } + ] + } + } + } + }, + { + "verify": { + "jobs": { + "verify": { + "tasks": [ + { + "exec": { + "arguments": [ + "verify us2" + ], + "command": "echo" + } + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } } } diff --git a/test/testdata/goldens/pipedream/different-stages-per-region.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/different-stages-per-region.jsonnet_single-file.golden index f6f6c27..09d475c 100644 --- a/test/testdata/goldens/pipedream/different-stages-per-region.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/different-stages-per-region.jsonnet_single-file.golden @@ -140,14 +140,14 @@ ] }, "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "init_repo": { @@ -340,6 +340,77 @@ } } ] + }, + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "init_repo": { + "branch": "main", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "tasks": [ + { + "exec": { + "arguments": [ + "deploy us2" + ], + "command": "echo" + } + } + ] + } + } + } + }, + { + "verify": { + "jobs": { + "verify": { + "tasks": [ + { + "exec": { + "arguments": [ + "verify us2" + ], + "command": "echo" + } + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] } } } diff --git a/test/testdata/goldens/pipedream/env-vars-precedence.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/env-vars-precedence.jsonnet_output-files.golden index 0bc0362..7d1c28b 100644 --- a/test/testdata/goldens/pipedream/env-vars-precedence.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/env-vars-precedence.jsonnet_output-files.golden @@ -62,14 +62,14 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 3, + "display_order": 4, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-s4s2-pipeline-complete": { - "pipeline": "deploy-example-s4s2", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -159,5 +159,68 @@ ] } } + }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 3, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-s4s2-pipeline-complete": { + "pipeline": "deploy-example-s4s2", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "environment_variables": { + "PIPELINE_VAR": "pipeline-us2", + "SHARED_VAR_JOB": "from-stage", + "SHARED_VAR_STAGE": "from-stage", + "STAGE_VAR": "stage-us2" + }, + "jobs": { + "deploy": { + "environment_variables": { + "JOB_VAR": "job-us2", + "SHARED_VAR_JOB": "from-job" + }, + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } } } diff --git a/test/testdata/goldens/pipedream/env-vars-precedence.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/env-vars-precedence.jsonnet_single-file.golden index 15f5642..013c1ca 100644 --- a/test/testdata/goldens/pipedream/env-vars-precedence.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/env-vars-precedence.jsonnet_single-file.golden @@ -56,14 +56,14 @@ ] }, "deploy-example-st": { - "display_order": 3, + "display_order": 4, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-s4s2-pipeline-complete": { - "pipeline": "deploy-example-s4s2", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -151,6 +151,64 @@ } } ] + }, + "deploy-example-us2": { + "display_order": 3, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-s4s2-pipeline-complete": { + "pipeline": "deploy-example-s4s2", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "environment_variables": { + "PIPELINE_VAR": "pipeline-us2", + "SHARED_VAR_JOB": "from-stage", + "SHARED_VAR_STAGE": "from-stage", + "STAGE_VAR": "stage-us2" + }, + "jobs": { + "deploy": { + "environment_variables": { + "JOB_VAR": "job-us2", + "SHARED_VAR_JOB": "from-job" + }, + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] } } } diff --git a/test/testdata/goldens/pipedream/exclude-entire-group.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/exclude-entire-group.jsonnet_output-files.golden index 06bb0ec..a81c551 100644 --- a/test/testdata/goldens/pipedream/exclude-entire-group.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/exclude-entire-group.jsonnet_output-files.golden @@ -159,5 +159,60 @@ ] } } + }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } } } diff --git a/test/testdata/goldens/pipedream/exclude-entire-group.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/exclude-entire-group.jsonnet_single-file.golden index 58aa2a4..0b30119 100644 --- a/test/testdata/goldens/pipedream/exclude-entire-group.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/exclude-entire-group.jsonnet_single-file.golden @@ -146,6 +146,56 @@ } } ] + }, + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] } } } diff --git a/test/testdata/goldens/pipedream/exclude-region.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/exclude-region.jsonnet_output-files.golden index f1631d4..9024b4a 100644 --- a/test/testdata/goldens/pipedream/exclude-region.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/exclude-region.jsonnet_output-files.golden @@ -109,14 +109,14 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -230,5 +230,60 @@ ] } } + }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } } } diff --git a/test/testdata/goldens/pipedream/exclude-region.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/exclude-region.jsonnet_single-file.golden index b232c1d..4b0c1e2 100644 --- a/test/testdata/goldens/pipedream/exclude-region.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/exclude-region.jsonnet_single-file.golden @@ -98,14 +98,14 @@ ] }, "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -212,6 +212,56 @@ } } ] + }, + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] } } } diff --git a/test/testdata/goldens/pipedream/include-default-excluded.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/include-default-excluded.jsonnet_output-files.golden index 854a6a7..57b2ab8 100644 --- a/test/testdata/goldens/pipedream/include-default-excluded.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/include-default-excluded.jsonnet_output-files.golden @@ -3,14 +3,14 @@ "format_version": 10, "pipelines": { "deploy-example-control": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "control" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -164,7 +164,7 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 6, + "display_order": 7, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, @@ -293,5 +293,60 @@ ] } } + }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } } } diff --git a/test/testdata/goldens/pipedream/include-default-excluded.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/include-default-excluded.jsonnet_single-file.golden index 8edfe2c..200e0d3 100644 --- a/test/testdata/goldens/pipedream/include-default-excluded.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/include-default-excluded.jsonnet_single-file.golden @@ -2,14 +2,14 @@ "format_version": 10, "pipelines": { "deploy-example-control": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "control" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -148,7 +148,7 @@ ] }, "deploy-example-st": { - "display_order": 6, + "display_order": 7, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, @@ -270,6 +270,56 @@ } } ] + }, + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] } } } diff --git a/test/testdata/goldens/pipedream/multi-region-group.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/multi-region-group.jsonnet_output-files.golden index 75d883c..978ad78 100644 --- a/test/testdata/goldens/pipedream/multi-region-group.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/multi-region-group.jsonnet_output-files.golden @@ -54,14 +54,14 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 3, + "display_order": 4, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-s4s2-pipeline-complete": { - "pipeline": "deploy-example-s4s2", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -128,5 +128,60 @@ ] } } + }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 3, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-s4s2-pipeline-complete": { + "pipeline": "deploy-example-s4s2", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } } } diff --git a/test/testdata/goldens/pipedream/multi-region-group.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/multi-region-group.jsonnet_single-file.golden index ad05869..89654fc 100644 --- a/test/testdata/goldens/pipedream/multi-region-group.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/multi-region-group.jsonnet_single-file.golden @@ -48,14 +48,14 @@ ] }, "deploy-example-st": { - "display_order": 3, + "display_order": 4, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-s4s2-pipeline-complete": { - "pipeline": "deploy-example-s4s2", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -120,6 +120,56 @@ } } ] + }, + "deploy-example-us2": { + "display_order": 3, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-s4s2-pipeline-complete": { + "pipeline": "deploy-example-s4s2", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] } } } diff --git a/test/testdata/goldens/pipedream/parallel-mode.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/parallel-mode.jsonnet_output-files.golden index f392592..70f94f9 100644 --- a/test/testdata/goldens/pipedream/parallel-mode.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/parallel-mode.jsonnet_output-files.golden @@ -113,7 +113,7 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, @@ -243,6 +243,61 @@ } } }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-pipeline-complete": { + "pipeline": "deploy-example", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } + }, "deploy-example.yaml": { "format_version": 10, "pipelines": { diff --git a/test/testdata/goldens/pipedream/parallel-mode.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/parallel-mode.jsonnet_single-file.golden index fb0dc99..d9d1ec7 100644 --- a/test/testdata/goldens/pipedream/parallel-mode.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/parallel-mode.jsonnet_single-file.golden @@ -135,7 +135,7 @@ ] }, "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, @@ -257,6 +257,56 @@ } } ] + }, + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-pipeline-complete": { + "pipeline": "deploy-example", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] } } } diff --git a/test/testdata/goldens/pipedream/region-suffixed-jobs.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/region-suffixed-jobs.jsonnet_output-files.golden index c143e9e..bcf5243 100644 --- a/test/testdata/goldens/pipedream/region-suffixed-jobs.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/region-suffixed-jobs.jsonnet_output-files.golden @@ -84,14 +84,14 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 3, + "display_order": 4, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-s4s2-pipeline-complete": { - "pipeline": "deploy-example-s4s2", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -260,5 +260,90 @@ ] } } + }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 3, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-s4s2-pipeline-complete": { + "pipeline": "deploy-example-s4s2", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "diff": { + "jobs": { + "diff-us2": { + "artifacts": [ + { + "build": { + "destination": "output", + "source": "result" + } + } + ], + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./diff.sh --region=us2" + } + ] + } + } + } + }, + { + "apply": { + "jobs": { + "apply-us2": { + "elastic_profile_id": "example", + "tasks": [ + { + "fetch": { + "destination": "artifacts", + "job": "diff-us2", + "source": "output", + "stage": "diff" + } + }, + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./apply.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } } } diff --git a/test/testdata/goldens/pipedream/region-suffixed-jobs.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/region-suffixed-jobs.jsonnet_single-file.golden index a48d77c..28b918c 100644 --- a/test/testdata/goldens/pipedream/region-suffixed-jobs.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/region-suffixed-jobs.jsonnet_single-file.golden @@ -78,14 +78,14 @@ ] }, "deploy-example-st": { - "display_order": 3, + "display_order": 4, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-s4s2-pipeline-complete": { - "pipeline": "deploy-example-s4s2", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -252,6 +252,86 @@ } } ] + }, + "deploy-example-us2": { + "display_order": 3, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-s4s2-pipeline-complete": { + "pipeline": "deploy-example-s4s2", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "diff": { + "jobs": { + "diff-us2": { + "artifacts": [ + { + "build": { + "destination": "output", + "source": "result" + } + } + ], + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./diff.sh --region=us2" + } + ] + } + } + } + }, + { + "apply": { + "jobs": { + "apply-us2": { + "elastic_profile_id": "example", + "tasks": [ + { + "fetch": { + "destination": "artifacts", + "job": "diff-us2", + "source": "output", + "stage": "diff" + } + }, + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./apply.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] } } } diff --git a/test/testdata/goldens/pipedream/rollback-final-stage-override.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/rollback-final-stage-override.jsonnet_output-files.golden index a302b60..46cbd20 100644 --- a/test/testdata/goldens/pipedream/rollback-final-stage-override.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/rollback-final-stage-override.jsonnet_output-files.golden @@ -109,14 +109,14 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -239,15 +239,70 @@ } } }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } + }, "rollback-example.yaml": { "format_version": 10, "pipelines": { "rollback-example": { "display_order": 1, "environment_variables": { - "ALL_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-st", + "ALL_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-us2 --pipeline=deploy-example-st", "GOCD_ACCESS_TOKEN": "{{SECRET:[devinfra][gocd_access_token]}}", - "REGION_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-st", + "REGION_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-us2 --pipeline=deploy-example-st", "ROLLBACK_MATERIAL_NAME": "example_repo", "ROLLBACK_STAGE": "deploy", "TRIGGERED_BY": "" diff --git a/test/testdata/goldens/pipedream/rollback-final-stage-override.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/rollback-final-stage-override.jsonnet_single-file.golden index e1d5ee3..2a40173 100644 --- a/test/testdata/goldens/pipedream/rollback-final-stage-override.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/rollback-final-stage-override.jsonnet_single-file.golden @@ -98,14 +98,14 @@ ] }, "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -221,12 +221,62 @@ } ] }, + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + }, "rollback-example": { "display_order": 1, "environment_variables": { - "ALL_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-st", + "ALL_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-us2 --pipeline=deploy-example-st", "GOCD_ACCESS_TOKEN": "{{SECRET:[devinfra][gocd_access_token]}}", - "REGION_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-st", + "REGION_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-us2 --pipeline=deploy-example-st", "ROLLBACK_MATERIAL_NAME": "example_repo", "ROLLBACK_STAGE": "deploy", "TRIGGERED_BY": "" diff --git a/test/testdata/goldens/pipedream/rollback.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/rollback.jsonnet_output-files.golden index 5e32798..aa50934 100644 --- a/test/testdata/goldens/pipedream/rollback.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/rollback.jsonnet_output-files.golden @@ -109,14 +109,14 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -239,15 +239,70 @@ } } }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } + }, "rollback-example.yaml": { "format_version": 10, "pipelines": { "rollback-example": { "display_order": 1, "environment_variables": { - "ALL_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-st", + "ALL_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-us2 --pipeline=deploy-example-st", "GOCD_ACCESS_TOKEN": "{{SECRET:[devinfra][gocd_access_token]}}", - "REGION_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-st", + "REGION_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-us2 --pipeline=deploy-example-st", "ROLLBACK_MATERIAL_NAME": "example_repo", "ROLLBACK_STAGE": "deploy", "TRIGGERED_BY": "" diff --git a/test/testdata/goldens/pipedream/rollback.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/rollback.jsonnet_single-file.golden index f594fee..a57a8e5 100644 --- a/test/testdata/goldens/pipedream/rollback.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/rollback.jsonnet_single-file.golden @@ -98,14 +98,14 @@ ] }, "deploy-example-st": { - "display_order": 5, + "display_order": 6, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-us-pipeline-complete": { - "pipeline": "deploy-example-us", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -221,12 +221,62 @@ } ] }, + "deploy-example-us2": { + "display_order": 5, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-us-pipeline-complete": { + "pipeline": "deploy-example-us", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "destination": "example", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "jobs": { + "deploy": { + "elastic_profile_id": "example", + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + }, "rollback-example": { "display_order": 1, "environment_variables": { - "ALL_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-st", + "ALL_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-us2 --pipeline=deploy-example-st", "GOCD_ACCESS_TOKEN": "{{SECRET:[devinfra][gocd_access_token]}}", - "REGION_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-st", + "REGION_PIPELINE_FLAGS": "--pipeline=deploy-example-s4s2 --pipeline=deploy-example-de --pipeline=deploy-example-us --pipeline=deploy-example-us2 --pipeline=deploy-example-st", "ROLLBACK_MATERIAL_NAME": "example_repo", "ROLLBACK_STAGE": "deploy", "TRIGGERED_BY": "" diff --git a/test/testdata/goldens/pipedream/stage-props.jsonnet_output-files.golden b/test/testdata/goldens/pipedream/stage-props.jsonnet_output-files.golden index 063fe34..fec5220 100644 --- a/test/testdata/goldens/pipedream/stage-props.jsonnet_output-files.golden +++ b/test/testdata/goldens/pipedream/stage-props.jsonnet_output-files.golden @@ -56,14 +56,14 @@ "format_version": 10, "pipelines": { "deploy-example-st": { - "display_order": 3, + "display_order": 4, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-s4s2-pipeline-complete": { - "pipeline": "deploy-example-s4s2", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -129,5 +129,62 @@ ] } } + }, + "deploy-example-us2.yaml": { + "format_version": 10, + "pipelines": { + "deploy-example-us2": { + "display_order": 3, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-s4s2-pipeline-complete": { + "pipeline": "deploy-example-s4s2", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "approval": { + "type": "manual" + }, + "fetch_materials": true, + "jobs": { + "deploy": { + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] + } + } } } diff --git a/test/testdata/goldens/pipedream/stage-props.jsonnet_single-file.golden b/test/testdata/goldens/pipedream/stage-props.jsonnet_single-file.golden index 5adae46..bf5b3ef 100644 --- a/test/testdata/goldens/pipedream/stage-props.jsonnet_single-file.golden +++ b/test/testdata/goldens/pipedream/stage-props.jsonnet_single-file.golden @@ -50,14 +50,14 @@ ] }, "deploy-example-st": { - "display_order": 3, + "display_order": 4, "environment_variables": { "PIPEDREAM_GROUP_REGIONS": "customer-1,customer-2,customer-4,customer-7" }, "group": "example", "materials": { - "deploy-example-s4s2-pipeline-complete": { - "pipeline": "deploy-example-s4s2", + "deploy-example-us2-pipeline-complete": { + "pipeline": "deploy-example-us2", "stage": "pipeline-complete" }, "example_repo": { @@ -121,6 +121,58 @@ } } ] + }, + "deploy-example-us2": { + "display_order": 3, + "environment_variables": { + "PIPEDREAM_GROUP_REGIONS": "us2" + }, + "group": "example", + "materials": { + "deploy-example-s4s2-pipeline-complete": { + "pipeline": "deploy-example-s4s2", + "stage": "pipeline-complete" + }, + "example_repo": { + "branch": "master", + "git": "git@github.com:getsentry/example.git" + } + }, + "stages": [ + { + "deploy": { + "approval": { + "type": "manual" + }, + "fetch_materials": true, + "jobs": { + "deploy": { + "tasks": [ + { + "script": "if [ -n \"${PIPEDREAM_GROUP_REGIONS:-}\" ] && [ -n \"${SENTRY_REGION:-}\" ]; then\n case \",${PIPEDREAM_GROUP_REGIONS},\" in\n *\",${SENTRY_REGION},\"*) ;;\n *)\n echo \"Skipping $SENTRY_REGION (not in PIPEDREAM_GROUP_REGIONS=$PIPEDREAM_GROUP_REGIONS)\"\n exit 0\n ;;\n esac\nfi\n./deploy.sh --region=us2" + } + ] + } + } + } + }, + { + "pipeline-complete": { + "fetch_materials": false, + "jobs": { + "pipeline-complete": { + "tasks": [ + { + "exec": { + "command": true + } + } + ] + } + } + } + } + ] } } }