-
Notifications
You must be signed in to change notification settings - Fork 264
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
Showing
3 changed files
with
42 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Fixed values- consider setting them in `.bash_profile` or `bashrc` | ||
# REMOTE is the name of the primary repo's remote on your machine. Typically `upstream` or `origin` | ||
REMOTE=origin | ||
# MM_REPO should point to your checked-out copy of the GoogleCloudPlatform/magic-modules repo | ||
MM_REPO="/Users/zhenhuali/Documents/workspace/magic-modules-original" | ||
# https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token, no permissions | ||
export GITHUB_TOKEN=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 | ||
|
||
# Fill these in each time | ||
# COMMIT_SHA is build.vcs.number in TeamCity | ||
COMMIT_SHA=2aead38a9fd6a7d646cf2a56ce766f21ceaf5912 | ||
RELEASE_VERSION=4.82.0 | ||
PREVIOUS_RELEASE_VERSION=4.81.0 | ||
|
||
COMMIT_SHA_OF_LAST_RELEASE=`git merge-base main v${PREVIOUS_RELEASE_VERSION}` | ||
REPO_NAME=$(basename $(git rev-parse --show-toplevel)) | ||
# use [ -n "$COMMIT_SHA" ] to make sure COMMIT_SHA is set, `git checkout` is a valid command on its own | ||
git pull $REMOTE main --tags && [ -n "$COMMIT_SHA" ] && git checkout $COMMIT_SHA && git checkout -b release-$RELEASE_VERSION && git push -u $REMOTE release-$RELEASE_VERSION | ||
COMMIT_SHA_OF_LAST_COMMIT_IN_CURRENT_RELEASE=`git rev-list -n 1 HEAD` | ||
go install github.com/paultyng/changelog-gen@91f787dc0cf1eedf016a444740cd28a4f1370e4 | ||
changelog-gen -repo $REPO_NAME -branch main -owner hashicorp -changelog ${MM_REPO}/.ci/changelog.tmpl -releasenote ${MM_REPO}/.ci/release-note.tmpl -no-note-label "changelog: no-release-note" $COMMIT_SHA_OF_LAST_RELEASE $COMMIT_SHA_OF_LAST_COMMIT_IN_CURRENT_RELEASE | ||
open https://github.com/hashicorp/$REPO_NAME/edit/release-$RELEASE_VERSION/CHANGELOG.md |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
go list ./google-beta/... | ||
SERVICE_LIST=$(go list ./google-beta/... 2>/dev/null | head -n -1) | ||
|
||
for service in SERVICE_LIST | ||
do | ||
echo $service | ||
|
||
service_folder=$(echo $service | sed 's/github.com\/hashicorp\/terraform-provider-google-beta/./') | ||
echo $service_folder | ||
cd ${service_folder} | ||
done |