Skip to content

Commit

Permalink
Remove tgc build from downstream builder (GoogleCloudPlatform#8472)
Browse files Browse the repository at this point in the history
  • Loading branch information
trodge authored Aug 4, 2023
1 parent 3eb4cef commit bcc8c94
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 32 deletions.
12 changes: 6 additions & 6 deletions .ci/gcb-generate-diffs-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ steps:
entrypoint: '/workspace/.ci/scripts/build-environment/downstream-builder/generate_downstream.sh'
id: tgc-head
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["merged", "tpg-head"]
waitFor: ["merged"]
env:
- BASE_BRANCH=$_BASE_BRANCH
args:
Expand All @@ -142,7 +142,7 @@ steps:
entrypoint: '/workspace/.ci/scripts/build-environment/downstream-builder/generate_downstream.sh'
id: tgc-base
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["merged", "tpg-base"]
waitFor: ["merged"]
env:
- BASE_BRANCH=$_BASE_BRANCH
args:
Expand Down Expand Up @@ -184,7 +184,7 @@ steps:
env:
- BUILD_ID=$BUILD_ID
- PROJECT_ID=$PROJECT_ID
- BUILD_STEP="17"
- BUILD_STEP=17
- COMMIT_SHA=$COMMIT_SHA
- PR_NUMBER=$_PR_NUMBER
args:
Expand All @@ -195,7 +195,7 @@ steps:
id: tgc-test
allowFailure: true
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["tgc-head", "tgc-base"]
waitFor: ["tpgb-head", "tpgb-base", "tgc-head", "tgc-base"]
env:
- TEST_PROJECT=$_VALIDATOR_TEST_PROJECT
- TEST_FOLDER_ID=$_VALIDATOR_TEST_FOLDER
Expand All @@ -214,7 +214,7 @@ steps:
entrypoint: '/workspace/.ci/scripts/go-plus/terraform-validator-tester-integration/test_terraform_validator_integration.sh'
allowFailure: true
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["tgc-head", "tgc-base"]
waitFor: ["tpgb-head", "tpgb-base", "tgc-head", "tgc-base"]
env:
- TERRAFORM_VERSION=0.12.31
- TEST_PROJECT=$_VALIDATOR_TEST_PROJECT
Expand All @@ -234,7 +234,7 @@ steps:
entrypoint: '/workspace/.ci/scripts/go-plus/terraform-validator-tester-integration/test_terraform_validator_integration.sh'
allowFailure: true
secretEnv: ["GITHUB_TOKEN"]
waitFor: ["tgc-head", "tgc-base"]
waitFor: ["tpgb-head", "tpgb-base", "tgc-head", "tgc-base"]
env:
- TERRAFORM_VERSION=0.13.7
- TEST_PROJECT=$_VALIDATOR_TEST_PROJECT
Expand Down
10 changes: 5 additions & 5 deletions .ci/gcb-push-downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ steps:
- |
if [ "$BRANCH_NAME" == "main" ]; then
git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tpg-sync
else
else
git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tpg-sync-$BRANCH_NAME
fi
Expand Down Expand Up @@ -90,7 +90,7 @@ steps:
- |
if [ "$BRANCH_NAME" == "main" ]; then
git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tpgb-sync
else
else
git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tpgb-sync-$BRANCH_NAME
fi
Expand All @@ -107,7 +107,7 @@ steps:
- name: 'gcr.io/graphite-docker-images/downstream-builder'
secretEnv: ["GITHUB_TOKEN"]
id: tgc-push
waitFor: ["tgc-sync", "tpg-push"]
waitFor: ["tgc-sync", "tpgb-push"]
env:
- BASE_BRANCH=$BRANCH_NAME
args:
Expand All @@ -125,7 +125,7 @@ steps:
- |
if [ "$BRANCH_NAME" == "main" ]; then
git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tgc-sync
else
else
git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tgc-sync-$BRANCH_NAME
fi
Expand Down Expand Up @@ -160,7 +160,7 @@ steps:
- |
if [ "$BRANCH_NAME" == "main" ]; then
git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tf-oics-sync
else
else
git push https://modular-magician:[email protected]/GoogleCloudPlatform/magic-modules $COMMIT_SHA:tf-oics-sync-$BRANCH_NAME
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,31 +119,15 @@ if [ "$REPO" == "terraform-google-conversion" ]; then

bundle exec compiler.rb -a -e terraform -f validator -o $LOCAL_PATH/tfplan2cai -v $VERSION

pushd $LOCAL_PATH

if [ "$COMMAND" == "downstream" ]; then
pushd $LOCAL_PATH
go get -d github.com/hashicorp/terraform-provider-google-beta@$BASE_BRANCH
else
go mod edit -replace github.com/hashicorp/terraform-provider-google-beta=github.com/$SCRATCH_OWNER/terraform-provider-google-beta@$BRANCH
fi


go mod tidy

# the following build can fail which results in a subsequent failure to push to tfv repository.
# due to the uncertainty of tpg being able to build we will ignore errors here
# as these files are not critical to operation of tfv and not worth blocking the GA pipeline
if [ "$COMMAND" == "downstream" ]; then
go mod tidy
set +e
fi

make build

if [ "$COMMAND" == "downstream" ]; then
make build
set -e
popd
fi

popd
elif [ "$REPO" == "tf-oics" ]; then
# use terraform generator with oics override
bundle exec compiler.rb -a -e terraform -f oics -o $LOCAL_PATH -v $VERSION
Expand Down Expand Up @@ -229,4 +213,4 @@ if [ "$COMMITTED" == "true" ] && [ "$COMMAND" == "downstream" ]; then
"https://api.github.com/repos/$UPSTREAM_OWNER/$GH_REPO/pulls/$NEW_PR_NUMBER/merge"
fi

popd
popd
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ curl \

set +e

go mod edit -replace github.com/hashicorp/terraform-provider-google-beta=github.com/$github_username/terraform-provider-google-beta@$new_branch
go mod tidy

make build
make test-integration
exit_code=$?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ curl \

set +e

go mod edit -replace github.com/hashicorp/terraform-provider-google-beta=github.com/$github_username/terraform-provider-google-beta@$new_branch
go mod tidy

make test
exit_code=$?

Expand Down

0 comments on commit bcc8c94

Please sign in to comment.