-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: refactor
teamcity-weekly-roachtest.sh
to depend on common code
We can use the helper functionality here to log into `gcloud`, and the helper code will clean the credentials up after the fact. Also adopt the same pattern for SSH keys, and make sure they get cleaned up too. Release note: None
- Loading branch information
1 parent
4640147
commit 6651a08
Showing
4 changed files
with
38 additions
and
21 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,15 @@ | ||
# Common logic shared by build/teamcity-support.sh and build/release/teamcity-support.sh. | ||
|
||
# Call this to clean up after using any other functions from this file. | ||
common_support_remove_files_on_exit() { | ||
rm -f .google-credentials.json | ||
} | ||
|
||
log_into_gcloud() { | ||
if [[ "${google_credentials}" ]]; then | ||
echo "${google_credentials}" > .google-credentials.json | ||
gcloud auth activate-service-account --key-file=.google-credentials.json | ||
else | ||
echo 'warning: `google_credentials` not set' >&2 | ||
fi | ||
} |
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