Skip to content

Commit

Permalink
[TECH] Updated to use new prm team docker hub credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
rosienhs committed Mar 9, 2023
1 parent 5360081 commit 47f9f50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Dojofile.example
.terraform
*.png
ops/
.idea/
9 changes: 7 additions & 2 deletions tasks
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ image_dir="./image"
imagerc_filename="imagerc"

function docker_login {
if [ -z "$DOCKERHUB_USERNAME" ]; then
echo "DOCKERHUB_USERNAME must be your dockerhub username or an API token"
exit 5;
fi
if [ -z "$DOCKERHUB_PASSWORD" ]; then
echo "DOCKERHUB_PASSWORD must be your dockerhub password or an API token"
exit 5;
fi
echo "$DOCKERHUB_PASSWORD" | docker login --username nhstomzo --password-stdin
echo "$DOCKERHUB_PASSWORD" | docker login --username $DOCKERHUB_USERNAME --password-stdin
}

function get_aws_ssm_secret {
Expand All @@ -43,7 +47,8 @@ case "${command}" in
docker_ops::docker_build "${image_dir}" "${imagerc_filename}" "${image_name}" "${image_tag}" "${image_registry}"
;;
build)
DOCKERHUB_PASSWORD=$(get_aws_ssm_secret "/repo/prod/user-input/gocd-dockerhub-password")
DOCKERHUB_USERNAME=$(get_aws_ssm_secret "/repo/prod/user-input/prm-team-dockerhub-username")
DOCKERHUB_PASSWORD=$(get_aws_ssm_secret "/repo/prod/user-input/prm-team-dockerhub-password")
docker_login
./tasks build_local
docker_ops::push "${image_dir}" "${imagerc_filename}"
Expand Down

0 comments on commit 47f9f50

Please sign in to comment.