From 1508570c0327e1b710d0f1c3b6054bc5a607491a Mon Sep 17 00:00:00 2001 From: Nathan Mckinley Date: Thu, 23 Sep 2021 14:28:44 -0700 Subject: [PATCH] Changes to containers to support DCL's build - open up test to work on multiple repos. --- .ci/containers/terraform-tester/test_terraform.sh | 12 +++++++++--- .ci/gcb-generate-diffs.yml | 2 ++ GNUmakefile | 5 ++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.ci/containers/terraform-tester/test_terraform.sh b/.ci/containers/terraform-tester/test_terraform.sh index 8e9106705e4d..a9707e10613f 100755 --- a/.ci/containers/terraform-tester/test_terraform.sh +++ b/.ci/containers/terraform-tester/test_terraform.sh @@ -7,7 +7,13 @@ pr_number=$2 mm_commit_sha=$3 build_id=$4 project_id=$5 -build_step=$6 +repo_name=$6 +build_step=$7 +if [ -z "$7" ]; then + # an old run - any time after october 15 2021 this can be removed. + repo_name=GoogleCloudPlatform/magic-modules + build_step=$6 +fi github_username=modular-magician if [ "$version" == "ga" ]; then gh_repo=terraform-provider-google @@ -47,7 +53,7 @@ curl \ -X POST \ -u "$github_username:$GITHUB_TOKEN" \ -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/$mm_commit_sha" \ + "https://api.github.com/repos/$repo_name/statuses/$mm_commit_sha" \ -d "$post_body" @@ -61,7 +67,7 @@ curl \ -X POST \ -u "$github_username:$GITHUB_TOKEN" \ -H "Accept: application/vnd.github.v3+json" \ - "https://api.github.com/repos/GoogleCloudPlatform/magic-modules/statuses/$mm_commit_sha" \ + "https://api.github.com/repos/$repo_name/statuses/$mm_commit_sha" \ -d "$post_body" set +e diff --git a/.ci/gcb-generate-diffs.yml b/.ci/gcb-generate-diffs.yml index 928ac514cf7e..b99ae335f294 100644 --- a/.ci/gcb-generate-diffs.yml +++ b/.ci/gcb-generate-diffs.yml @@ -192,6 +192,7 @@ steps: - $COMMIT_SHA - $BUILD_ID - $PROJECT_ID + - GoogleCloudPlatform/magic-modules - "22" # Build step - name: 'gcr.io/graphite-docker-images/terraform-tester' @@ -204,6 +205,7 @@ steps: - $COMMIT_SHA - $BUILD_ID - $PROJECT_ID + - GoogleCloudPlatform/magic-modules - "23" # Build step - name: 'gcr.io/graphite-docker-images/terraform-vcr-tester' diff --git a/GNUmakefile b/GNUmakefile index f9100875cad2..ad0d511f7dd5 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -40,6 +40,9 @@ SED_I := -i '' -E ECHO_ARGS := endif +ifeq ($(FORCE_DCL),) + FORCE_DCL=latest +endif terraform build: make serialize make mmv1 @@ -67,7 +70,7 @@ serialize: upgrade-dcl: cd tpgtools && \ go mod edit -dropreplace=github.com/GoogleCloudPlatform/declarative-resource-client-library &&\ - go mod edit -require=github.com/GoogleCloudPlatform/declarative-resource-client-library@latest &&\ + go mod edit -require=github.com/GoogleCloudPlatform/declarative-resource-client-library@$(FORCE_DCL) &&\ go mod tidy;\ MOD_LINE=$$(grep declarative-resource-client-library go.mod);\ SUM_LINE=$$(grep declarative-resource-client-library go.sum);\