-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a prepare_release.sh script that automates some manual steps. (#524)
- Loading branch information
Showing
2 changed files
with
67 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
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,59 @@ | ||
#!/bin/bash | ||
# | ||
# A helper script to update the storage versions and prepare a commit for | ||
# release. | ||
# | ||
|
||
DIR=$(dirname "$0") | ||
|
||
cd "$DIR"/.. | ||
VERSION= | ||
|
||
function update_version() { | ||
echo "" | ||
echo "==== Updating BT and BQ versions ====" | ||
|
||
BT=$(curl https://autopush.datacommons.org/version 2>/dev/null | awk '{ if ($1~/^borgcron_/) print $1; }') | ||
printf "$BT" > deploy/storage/bigtable.version | ||
|
||
BQ=$(curl https://autopush.datacommons.org/version 2>/dev/null | awk '{ if ($1~/^datcom-store/) print $1; }') | ||
printf "$BQ" > deploy/storage/bigquery.version | ||
|
||
VERSION="${BT//borgcron_/}" | ||
} | ||
|
||
function update_proto() { | ||
echo "" | ||
echo "==== Updating go proto files ====" | ||
protoc --proto_path=proto --go_out=internal --go-grpc_out=internal \ | ||
--go-grpc_opt=requireUnimplementedServers=false proto/*.proto | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Failed to update proto" | ||
exit 1 | ||
fi | ||
} | ||
|
||
function update_golden() { | ||
echo "" | ||
echo "==== Updating staging golden files ====" | ||
./scripts/update_golden_staging.sh | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Failed to update proto" | ||
exit 1 | ||
fi | ||
} | ||
|
||
function commit() { | ||
echo "" | ||
echo "==== Committing the change ====" | ||
git commit -a -m "Data Release: $VERSION" | ||
} | ||
|
||
update_version | ||
update_proto | ||
update_golden | ||
commit | ||
|
||
echo "" | ||
echo "NOTE: Please review the commit, push to your remote repo and create a PR." | ||
echo "" |