forked from fluent/fluent-bit
-
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.
CI/CD Pipeline: Add sync mechanism and publish SSM parameters (fluent#22
- Loading branch information
1 parent
e295703
commit 0dfbeb0
Showing
5 changed files
with
168 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: 0.2 | ||
phases: | ||
install: | ||
runtime-versions: | ||
golang: 1.12 | ||
pre_build: | ||
commands: | ||
- echo Publish SSM parameters | ||
build: | ||
commands: | ||
- './scripts/publish_test.sh cicd-publish-ssm ${AWS_REGION}' | ||
|
||
# Assume role to verify, get the credentials, and set them as environment variables. | ||
# Verification should be done using the credentials from a different account. It ensures that | ||
# the ssm parameters we published are public and accessible from any account. | ||
- CREDS=`aws sts assume-role --role-arn ${VERIFY_ROLE_ARN} --role-session-name ${AWS_REGION} --region ${AWS_REGION}` | ||
- export AWS_ACCESS_KEY_ID=`echo $CREDS | jq -r .Credentials.AccessKeyId` | ||
- export AWS_SECRET_ACCESS_KEY=`echo $CREDS | jq -r .Credentials.SecretAccessKey` | ||
- export AWS_SESSION_TOKEN=`echo $CREDS | jq -r .Credentials.SessionToken` | ||
|
||
- './scripts/publish_test.sh cicd-verify-ssm ${AWS_REGION}' | ||
artifacts: | ||
files: | ||
- '**/*' |
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,26 @@ | ||
version: 0.2 | ||
phases: | ||
install: | ||
runtime-versions: | ||
golang: 1.12 | ||
pre_build: | ||
commands: | ||
- echo Sync latest image from Dockerhub | ||
build: | ||
commands: | ||
- './scripts/publish_test.sh cicd-publish ${AWS_REGION}' | ||
|
||
# Assume role to verify, get the credentials, and set them as environment variables. | ||
# Verification should be done using the credentials from a different account. It ensures that | ||
# the images we published are public and accessible from any account. | ||
- CREDS=`aws sts assume-role --role-arn ${VERIFY_ROLE_ARN} --role-session-name ${AWS_REGION} --region ${AWS_REGION}` | ||
- export AWS_ACCESS_KEY_ID=`echo $CREDS | jq -r .Credentials.AccessKeyId` | ||
- export AWS_SECRET_ACCESS_KEY=`echo $CREDS | jq -r .Credentials.SecretAccessKey` | ||
- export AWS_SESSION_TOKEN=`echo $CREDS | jq -r .Credentials.SessionToken` | ||
|
||
# Verify from the verification account | ||
- './scripts/publish_test.sh cicd-verify ${AWS_REGION}' | ||
- './scripts/publish_test.sh cicd-verify-ssm ${AWS_REGION}' | ||
artifacts: | ||
files: | ||
- '**/*' |
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