From 5645c22b315ca4eaec87bb4b619e951a149eda77 Mon Sep 17 00:00:00 2001 From: Scott Suarez Date: Wed, 26 Jan 2022 08:41:22 -0800 Subject: [PATCH] check in tpg into tfv repository (#5641) --- .ci/containers/downstream-builder/Dockerfile | 3 +-- .ci/containers/downstream-builder/generate_downstream.sh | 9 ++++++++- .ci/gcb-generate-diffs.yml | 4 ++-- .ci/gcb-push-downstream.yml | 2 +- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.ci/containers/downstream-builder/Dockerfile b/.ci/containers/downstream-builder/Dockerfile index 8ded2f5b9a6f..d036d5e1a07a 100644 --- a/.ci/containers/downstream-builder/Dockerfile +++ b/.ci/containers/downstream-builder/Dockerfile @@ -13,8 +13,7 @@ ENV GO111MODULE "on" # Install Ruby from source. RUN apt-get update -RUN apt-get install -y bzip2 libssl-dev libreadline-dev zlib1g-dev unzip -RUN apt-get install -y rsync +RUN apt-get install -y bzip2 libssl-dev libreadline-dev zlib1g-dev unzip sed rsync RUN git clone https://github.com/rbenv/rbenv.git /rbenv ENV PATH /rbenv/bin:/root/.rbenv/shims:$PATH diff --git a/.ci/containers/downstream-builder/generate_downstream.sh b/.ci/containers/downstream-builder/generate_downstream.sh index 0a91ca937aa9..fb39289f3ef8 100755 --- a/.ci/containers/downstream-builder/generate_downstream.sh +++ b/.ci/containers/downstream-builder/generate_downstream.sh @@ -106,16 +106,23 @@ if [ "$REPO" == "terraform-validator" ] || [ "$REPO" == "tf-conversion" ]; then # require a `google` folder to exist. mkdir -p $LOCAL_PATH/google fi + pushd $LOCAL_PATH # clear out the templates as they are copied during # generation from mmv1/third_party/validator/tests/data rm -rf ./testdata/templates/ rm -rf ./testdata/generatedconvert/ - git add ./testdata + rm -rf ./converters/google/provider find ./test/** -type f -exec git rm {} \; + popd bundle exec compiler -a -e terraform -f validator -o $LOCAL_PATH -v $VERSION pushd $LOCAL_PATH + + git clone --depth=1 --branch=$BRANCH https://modular-magician:$GITHUB_TOKEN@github.com/$SCRATCH_OWNER/terraform-provider-google converters/google/provider + rm -rf ./converters/google/provider/.git + go mod edit -replace github.com/hashicorp/terraform-provider-google/v4@v4.4.1=./converters/google/provider + make build export TFV_CREATE_GENERATED_FILES=true go test ./test -run "TestAcc.*_generated_offline" diff --git a/.ci/gcb-generate-diffs.yml b/.ci/gcb-generate-diffs.yml index 3a132963a439..5cfc9aec7305 100644 --- a/.ci/gcb-generate-diffs.yml +++ b/.ci/gcb-generate-diffs.yml @@ -112,7 +112,7 @@ steps: - name: 'gcr.io/graphite-docker-images/downstream-builder' id: tfv-head secretEnv: ["GITHUB_TOKEN"] - waitFor: ["merged"] + waitFor: ["merged", "tpg-head"] args: - 'head' - 'terraform-validator' @@ -122,7 +122,7 @@ steps: - name: 'gcr.io/graphite-docker-images/downstream-builder' id: tfv-base secretEnv: ["GITHUB_TOKEN"] - waitFor: ["merged"] + waitFor: ["merged", "tpg-base"] args: - 'base' - 'terraform-validator' diff --git a/.ci/gcb-push-downstream.yml b/.ci/gcb-push-downstream.yml index 5f19e4f18e44..655890ad13cb 100644 --- a/.ci/gcb-push-downstream.yml +++ b/.ci/gcb-push-downstream.yml @@ -93,7 +93,7 @@ steps: - name: 'gcr.io/graphite-docker-images/downstream-builder' secretEnv: ["GITHUB_TOKEN"] id: tf-validator-push - waitFor: ["tf-validator-sync"] + waitFor: ["tf-validator-sync", "tpg-push"] args: - 'downstream' - 'terraform-validator'