Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing credential for docker plus adding retrieval from aws secret … #129

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion buildspec.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ phases:
- echo Logging in to Amazon ECR...
- aws --version
- $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)
- dockerusername=$(aws secretsmanager get-secret-value --secret-id docker_creds --query 'docker_username' --output text)
- password=$(aws secretsmanager get-secret-value --secret-id docker_creds --query 'password' --output text)
- REPOSITORY_URI=387065515315.dkr.ecr.us-east-1.amazonaws.com/ai/slackbot
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_TAG=build-$(echo $CODEBUILD_BUILD_ID | awk -F":" '{print $2}')
Expand All @@ -16,7 +18,7 @@ phases:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- docker login --username aiscience --password 2E9nUhgCB5smmQsa
- docker login --username $dockerusername --password $password
- docker build --cache-from $REPOSITORY_URI:latest -t $REPOSITORY_URI:latest ./apps/slackbot
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG

Expand Down