Skip to content

Commit db27916

Browse files
use personal access token for docker hub
1 parent 7f7bb16 commit db27916

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

cicd/3-app/aiproxy/buildspec.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
version: 0.2
2+
3+
env:
4+
secrets-manager:
5+
DOCKER_HUB_USERNAME: cicd/docker-hub/username
6+
DOCKER_HUB_PAT: cicd/docker-hub/pat
7+
28
phases:
39
install:
410
runtime-versions:
511
python: 3.11
612
commands:
713
- pip install cfn-lint
14+
15+
pre_build:
16+
commands:
17+
- echo Logging in to Docker Hub...
18+
- echo $DOCKER_HUB_PAT | docker login -u $DOCKER_HUB_USERNAME --password-stdin
19+
820
build:
921
# This will build and push the docker image to ECR and package the
1022
# Cloudformation template to be passed as an Artifact to future pipeline

cicd/3-app/aiproxy/pr-buildspec.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 0.2
33
env:
44
secrets-manager:
55
DOCKER_HUB_USERNAME: cicd/docker-hub/username
6-
DOCKER_HUB_PASSWORD: cicd/docker-hub/password
6+
DOCKER_HUB_PAT: cicd/docker-hub/pat
77

88
phases:
99
install:
@@ -15,7 +15,8 @@ phases:
1515
pre_build:
1616
commands:
1717
- echo Logging in to Docker Hub...
18-
- docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
18+
- echo $DOCKER_HUB_PAT | docker login -u $DOCKER_HUB_USERNAME --password-stdin
19+
1920

2021
build:
2122
# This should be moved to a shell script if it gets more complicated.

0 commit comments

Comments
 (0)