-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
178de0f
commit 474066d
Showing
2 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,74 @@ clone_repo | |
git config --local user.name "Modular Magician" | ||
git config --local user.email "[email protected]" | ||
|
||
if [ "$COMMAND" != "base" ]; then | ||
pushd mmv1 | ||
if [ "$REPO" == "terraform" ]; then | ||
pushd $LOCAL_PATH | ||
go mod download | ||
find . -type f -not -wholename "./.git*" -not -wholename "./.changelog*" -not -name ".travis.yml" -not -name ".golangci.yml" -not -name "CHANGELOG.md" -not -name "CHANGELOG_v*.md" -not -name "GNUmakefile" -not -name "docscheck.sh" -not -name "LICENSE" -not -name "README.md" -not -wholename "./examples*" -not -name ".go-version" -not -name ".hashibot.hcl" -print0 | xargs -0 git rm | ||
popd | ||
fi | ||
|
||
if [ "$REPO" == "terraform-google-conversion" ]; then | ||
# Generate tfplan2cai | ||
pushd $LOCAL_PATH | ||
# clear out the templates as they are copied during | ||
# generation from mmv1/third_party/validator/tests/data | ||
rm -rf ./tfplan2cai/testdata/templates/ | ||
rm -rf ./tfplan2cai/testdata/generatedconvert/ | ||
rm -rf ./tfplan2cai/converters/google/provider | ||
rm -rf ./tfplan2cai/converters/google/resources | ||
find ./tfplan2cai/test/** -type f -exec git rm {} \; | ||
popd | ||
|
||
bundle exec compiler.rb -a -e terraform -f validator -o $LOCAL_PATH/tfplan2cai -v $VERSION | ||
|
||
# Ignore 'tgc-base' step, because this is a new provider. | ||
# TODO: remove this condition on next cai2hcl-related PR. | ||
if [ "$COMMAND" != "base" ]; then | ||
# Generate cai2hcl | ||
pushd $LOCAL_PATH | ||
rm -rf ./cai2hcl/* | ||
popd | ||
|
||
bundle exec compiler.rb -a -e terraform -f tgc_cai2hcl -o $LOCAL_PATH/cai2hcl -v $VERSION | ||
fi | ||
|
||
if [ "$COMMAND" == "downstream" ]; then | ||
pushd $LOCAL_PATH | ||
go get -d github.com/hashicorp/terraform-provider-google-beta@$BASE_BRANCH | ||
go mod tidy | ||
set +e | ||
make build | ||
set -e | ||
popd | ||
fi | ||
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 | ||
else | ||
if [ "$REPO" == "terraform" ]; then | ||
if [ "$VERSION" == "ga" ]; then | ||
bundle exec compiler.rb -a -e $REPO -o $LOCAL_PATH -v $VERSION --no-docs | ||
bundle exec compiler.rb -a -e $REPO -o $LOCAL_PATH -v beta --no-code | ||
else | ||
bundle exec compiler.rb -a -e $REPO -o $LOCAL_PATH -v $VERSION | ||
fi | ||
pushd ../ | ||
make tpgtools OUTPUT_PATH=$LOCAL_PATH VERSION=$VERSION | ||
|
||
# Only generate TeamCity-related file for TPG and TPGB | ||
if [ "$VERSION" == "ga" ] || [ "$VERSION" == "beta" ]; then | ||
make teamcity-servicemap-generate OUTPUT_PATH=$LOCAL_PATH VERSION=$VERSION | ||
fi | ||
popd | ||
fi | ||
fi | ||
popd | ||
fi | ||
|
||
|
||
if [ "$COMMAND" == "head" ]; then | ||
BRANCH=auto-pr-$REFERENCE | ||
COMMIT_MESSAGE="New generated code for MM PR $REFERENCE." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,6 +102,6 @@ jobs: | |
clone_repo | ||
make tf-ocis | ||
else | ||
echo "case not supported" | ||
exit 1 | ||
echo "case not supported" | ||
exit 1 | ||
fi |