-
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.
Change publish maven repo to s3 bucket (#31)
* Change publish maven repo to s3 bucket * Remove mavenLocal from plugin repos, and set as last for dependency repos * bump version * bump to 1.2.1-dr-9 * Change groupd id * Add publish script * rename publish script * Add -x test to gradle publish
- Loading branch information
Showing
6 changed files
with
70 additions
and
6 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
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
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,57 @@ | ||
#!/bin/bash | ||
|
||
# Check if a profile argument is provided | ||
if [[ -z "$1" ]]; then | ||
echo "Usage: $0 <aws-profile>" | ||
exit 1 | ||
fi | ||
|
||
# AWS profile to use for fetching credentials | ||
AWS_PROFILE="$1" | ||
|
||
# Fetch credentials using AWS SSO and configure | ||
echo "Logging in to AWS SSO..." | ||
aws sso login --profile "$AWS_PROFILE" | ||
|
||
# Fetch and export credentials in environment variable format | ||
echo "Fetching temporary AWS credentials..." | ||
credentials=$(aws configure export-credentials --profile "$AWS_PROFILE" --format env-no-export) | ||
|
||
if [[ $? -ne 0 ]]; then | ||
echo "Failed to fetch credentials. Please ensure your profile is correctly configured." | ||
exit 1 | ||
fi | ||
|
||
# Parse and export the credentials as environment variables | ||
eval "$credentials" | ||
|
||
# Confirm the variables are set | ||
echo "AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID" | ||
echo "AWS_SECRET_ACCESS_KEY: [hidden]" | ||
echo "AWS_SESSION_TOKEN: [hidden]" | ||
|
||
# Optionally, verify with a simple AWS command | ||
aws sts get-caller-identity --profile "$AWS_PROFILE" | ||
if [[ $? -eq 0 ]]; then | ||
echo "AWS authentication successful." | ||
else | ||
echo "AWS authentication failed." | ||
exit 1 | ||
fi | ||
|
||
# Run Gradle publish task, passing AWS environment variables | ||
echo "Running Gradle publish task..." | ||
|
||
# Pass the environment variables to the Gradle process | ||
AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" \ | ||
AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \ | ||
AWS_SESSION_TOKEN="$AWS_SESSION_TOKEN" \ | ||
./gradlew publish -x test | ||
|
||
# Check for success or failure of the gradle publish task | ||
if [[ $? -eq 0 ]]; then | ||
echo "Gradle publish completed successfully." | ||
else | ||
echo "Gradle publish failed." | ||
exit 1 | ||
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