-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add release script to automate the release process
Co-authored-by: Nate Vick <nate.vick@hint.io>
- Loading branch information
1 parent
b0c8885
commit 07ec5ae
Showing
1 changed file
with
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
# Define the vault ID for DRY purposes | ||
VAULT_ID="hehpkyvswnpef4ywyqwi3dbclq" | ||
|
||
# Retrieve the RubyGems API key from 1Password and export it | ||
export GEM_HOST_API_KEY=$(op item get RubyGems --field label=api_key --vault $VAULT_ID) | ||
|
||
# Check if the GEM_HOST_API_KEY was successfully retrieved and is not empty | ||
if [ -z "$GEM_HOST_API_KEY" ]; then | ||
echo "Failed to retrieve RubyGems API key." | ||
exit 1 | ||
fi | ||
|
||
# Retrieve the OTP from 1Password | ||
GEM_HOST_OTP_CODE=$(op item get RubyGems --otp --vault $VAULT_ID) | ||
|
||
# Check if the GEM_HOST_OTP_CODE was successfully retrieved and is not empty | ||
if [ -z "$GEM_HOST_OTP_CODE" ]; then | ||
echo "Failed to retrieve RubyGems OTP." | ||
continue | ||
fi | ||
|
||
# Set RELEASE_PLATFORM and GEM_HOST_OTP_CODE temporarily and run rake release | ||
env GEM_HOST_OTP_CODE=$GEM_HOST_OTP_CODE rake release | ||
|
||
echo "Release completed." |