From 69a139a1b7d3b219cc9f01bb6abeb88fdde587e4 Mon Sep 17 00:00:00 2001 From: Andrew <4407063+andrewtpham@users.noreply.github.com> Date: Thu, 22 Sep 2022 14:47:07 +0200 Subject: [PATCH] Revert "feat(CI): update Docker credentials and docker image names (#781)" (#788) This reverts commit 937a3684f254e0192b6578fec90198176ab3e99c. --- .github/workflows/activity_ci_cd.yml | 16 ++++++++-------- ci-scripts/build_docker_image.sh | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/activity_ci_cd.yml b/.github/workflows/activity_ci_cd.yml index df4bb9cd..f3cf205c 100644 --- a/.github/workflows/activity_ci_cd.yml +++ b/.github/workflows/activity_ci_cd.yml @@ -100,10 +100,10 @@ jobs: - name: Build and Push env: TAG_NAME: ${{ github.event.release.tag_name }} - # DOCKER_HUB_USERNM: ${{ secrets.DOCKER_HUB_USERNM }} - # DOCKER_HUB_PASSWD: ${{ secrets.DOCKER_HUB_PASSWD }} - DOCKER_HUB_USERNAME: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - DOCKER_HUB_PASSWORD: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + DOCKER_HUB_USERNM: ${{ secrets.DOCKER_HUB_USERNM }} + DOCKER_HUB_PASSWD: ${{ secrets.DOCKER_HUB_PASSWD }} + DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} + DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} ACTIVITY_CE_DB_NAME_DEV: ${{ secrets.ACTIVITY_CE_DB_NAME_DEV }} ACTIVITY_CE_DB_USER_DEV: ${{ secrets.ACTIVITY_CE_DB_USER_DEV }} ACTIVITY_CE_DB_PASSWORD_DEV: ${{ secrets.ACTIVITY_CE_DB_PASSWORD_DEV }} @@ -146,10 +146,10 @@ jobs: APPLICATION_ENV: ${{ secrets.APPLICATION_ENV }} CLUSTER_NAME_DEV_ENV: ${{ secrets.CLUSTER_NAME_DEV_ENV }} SERVICE_ACCESS_TOKEN: ${{ secrets.SERVICE_ACCESS_TOKEN }} - # DOCKER_HUB_USERNM: ${{ secrets.DOCKER_HUB_USERNM }} - # DOCKER_HUB_PASSWD: ${{ secrets.DOCKER_HUB_PASSWD }} - DOCKER_HUB_USERNAME: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} - DOCKER_HUB_PASSWORD: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + DOCKER_HUB_USERNM: ${{ secrets.DOCKER_HUB_USERNM }} + DOCKER_HUB_PASSWD: ${{ secrets.DOCKER_HUB_PASSWD }} + DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} + DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }} B64_TOKEN: ${{ secrets.B64_TOKEN }} DEFAULT_NOTIFY: ${{ secrets.DEFAULT_NOTIFY }} RATE_LIMIT: ${{ secrets.RATE_LIMIT }} diff --git a/ci-scripts/build_docker_image.sh b/ci-scripts/build_docker_image.sh index 873991a0..8535a593 100644 --- a/ci-scripts/build_docker_image.sh +++ b/ci-scripts/build_docker_image.sh @@ -7,13 +7,13 @@ timestamp() { } #@--- Function to authenticate to docker hub ---@# -# docker_hub_auth() { -# if [[ $GITHUB_REF == "refs/heads/develop" ]] || [[ $GITHUB_EVENT_NAME == "release" ]] -# then -# docker login -p=$DOCKER_HUB_PASSWD -u=$DOCKER_HUB_USERNM -# fi +docker_hub_auth() { + if [[ $GITHUB_REF == "refs/heads/develop" ]] || [[ $GITHUB_EVENT_NAME == "release" ]] + then + docker login -p=$DOCKER_HUB_PASSWD -u=$DOCKER_HUB_USERNM + fi -# } +} #@--- Function to export env variables ---@# export_variables() { @@ -65,10 +65,10 @@ build_and_push_image() { docker push $REGISTRY_OWNER/activity:$APPLICATION_NAME-$APPLICATION_ENV-$GITHUB_SHA docker logout - docker login registry.digitalocean.com -p=$DOCKER_HUB_PASSWORD -u=$DOCKER_HUB_USERNAME + docker login -p=$DOCKER_HUB_PASSWORD -u=$DOCKER_HUB_USERNAME rm .env.deploy - docker build -t registry.digitalocean.com/hikaya/activity:$tag -f docker-deploy/Dockerfile . - docker push registry.digitalocean.com/hikaya/activity:$tag + docker build -t hikaya/activity:$tag -f docker-deploy/Dockerfile . + docker push hikaya/activity:$tag fi @@ -115,7 +115,7 @@ build_and_push_image() { main() { - # docker_hub_auth + docker_hub_auth build_and_push_image }