diff --git a/.github/workflows/core-api.build.deploy.dev.yaml b/.github/workflows/core-api.build.deploy.dev.yaml index b1891b562d..ee6e489b66 100644 --- a/.github/workflows/core-api.build.deploy.dev.yaml +++ b/.github/workflows/core-api.build.deploy.dev.yaml @@ -72,10 +72,8 @@ jobs: version: v2.7.9 # optional - name: oc login run: oc login --token=${{ secrets.BUILD_TOKEN }} --server=${{ secrets.CLUSTER_API }} - - name: argocd login - run: argocd login ${{ secrets.ARGOCD_SERVER }} --auth-token ${{ secrets.ARGO_CD_CLI_JWT }} --grpc-web --insecure - name: Notification - run: ./gitops/watch-deployment.sh core-api dev ${{ github.sha }} ${{ secrets.DISCORD_DEPLOYMENT_WEBHOOK }} + run: ./gitops/watch-deployment.sh core-api dev ${{ github.sha }} ${{ secrets.DISCORD_DEPLOYMENT_WEBHOOK }} ${{ secrets.ARGOCD_SERVER }} ${{ secrets.ARGO_CD_CLI_JWT }} run-if-failed: runs-on: ubuntu-20.04 diff --git a/gitops/watch-deployment.sh b/gitops/watch-deployment.sh index 8825737313..b2b059788b 100755 --- a/gitops/watch-deployment.sh +++ b/gitops/watch-deployment.sh @@ -5,6 +5,8 @@ TARGET_APP=${1?"Enter App Name !"} ENV=${2?"Enter ENV Name !"} GIT_SHA=${3?"Enter GIT SHA of commit!"} DISCORD_DEPLOYMENT_WEBHOOK=${4?"Enter DISCORD_DEPLOYMENT_WEBHOOK!"} +ARGOCD_SERVER=${5?"Enter ARGOCD_SERVER!"} +ARGOCD_AUTH_TOKEN=${6?"Enter ARGOCD_AUTH_TOKEN!"} REPO_LOCATION=$(git rev-parse --show-toplevel) @@ -24,8 +26,8 @@ echo -e "\n" echo "Watching for new revision of $TARGET_APP to be rolled out" echo "Waiting for $TARGET_APP to sync and be in healthy state" -argocd app sync $TARGET_APP -argocd app wait $TARGET_APP +argocd app sync $TARGET_APP --server $ARGOCD_SERVER --auth-token $ARGOCD_AUTH_TOKEN +argocd app wait $TARGET_APP --server $ARGOCD_SERVER --auth-token $ARGOCD_AUTH_TOKEN echo "Target Revision is achieved $CURRENT_REVISION"