-
Notifications
You must be signed in to change notification settings - Fork 19
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
54 additions
and
40 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
35 changes: 35 additions & 0 deletions
35
packages/blueprints/blueprint-builder/static-assets/release.sh
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,35 @@ | ||
# This script is used by the blueprint-release workflow to build | ||
# the blueprint, bump its package version, and commit the version | ||
# bump back into the repository. | ||
echo "Installing dependencies..." | ||
yum install -y rsync | ||
npm install -g yarn | ||
yarn | ||
|
||
echo "Building blueprint..." | ||
yarn build | ||
|
||
echo "Bumping package version..." | ||
yarn bump | ||
NEW_VERSION=`jq -r .version package.json` | ||
yarn blueprint:package | ||
|
||
echo "Getting credentials..." | ||
MI=`curl $AWS_CONTAINER_TOKEN_ENDPOINT` | ||
ACCESS_KEY_ID=$(echo "$MI" | jq -r '.AccessKeyId') | ||
SECRET_ACCESS_KEY=$(echo "$MI" | jq -r '.SecretAccessKey') | ||
ORIGINAL_REMOTE=`git config --get remote.origin.url` | ||
SOURCE_REPO_URL=`sed -e "s^//^//$ACCESS_KEY_ID:$SECRET_ACCESS_KEY@^" <<< $ORIGINAL_REMOTE` | ||
echo "Configuring git..." | ||
git remote set-url origin $SOURCE_REPO_URL | ||
git config --global user.email "noreply@amazon.com" | ||
git config --global user.name "Release Workflow" | ||
git add . | ||
echo "Committing changes..." | ||
RELEASE_COMMIT_MESSAGE="{{commitPrefix}} release $NEW_VERSION" | ||
git commit -m "$RELEASE_COMMIT_MESSAGE" | ||
echo "Pushing to origin..." | ||
git push origin HEAD:main |