From 605effb5bdf944bfbd399c440733d7d21c970fd2 Mon Sep 17 00:00:00 2001 From: Daryl Todosichuk Date: Mon, 23 Dec 2024 10:10:42 -0800 Subject: [PATCH] Fixing oc CLI --- .github/workflows/docker-build-main.yml | 35 +++++++++++++--------- .github/workflows/docker-build-test.yml | 35 +++++++++++++--------- .github/workflows/manual-trigger.yml | 40 ++++++++++++++----------- 3 files changed, 65 insertions(+), 45 deletions(-) diff --git a/.github/workflows/docker-build-main.yml b/.github/workflows/docker-build-main.yml index b006e9b..8c0bac5 100644 --- a/.github/workflows/docker-build-main.yml +++ b/.github/workflows/docker-build-main.yml @@ -168,12 +168,12 @@ jobs: - name: Build aspnetapp docker images run: docker compose build working-directory: ./applications/aspnetapp - - name: Build Docker images - run: | - rm -f ./docker-compose.override.yml - echo "buildArgs UNITY_BUILD_VERSION: ${{env.UGM_BUILD_VERSION}}, UNITY_BUILD_REVISION: ${{env.UGM_BUILD_REVISION}}" - docker compose build --build-arg UNITY_BUILD_VERSION=${{env.UGM_BUILD_VERSION}} --build-arg UNITY_BUILD_REVISION=${{env.UGM_BUILD_REVISION}} - working-directory: ./applications/Unity.GrantManager +# - name: Build Docker images +# run: | +# rm -f ./docker-compose.override.yml +# echo "buildArgs UNITY_BUILD_VERSION: ${{env.UGM_BUILD_VERSION}}, UNITY_BUILD_REVISION: ${{env.UGM_BUILD_REVISION}}" +# docker compose build --build-arg UNITY_BUILD_VERSION=${{env.UGM_BUILD_VERSION}} --build-arg UNITY_BUILD_REVISION=${{env.UGM_BUILD_REVISION}} +# working-directory: ./applications/Unity.GrantManager - name: Connect to JFrog Artifactory non-interactive login using --password-stdin run: | echo "$JFROG_PASSWORD" | docker login -u "$JFROG_USERNAME" --password-stdin $JFROG_SERVICE @@ -183,13 +183,20 @@ jobs: docker push $JFROG_SERVICE/$JFROG_REPO_PATH/dotnetapp:stable docker tag aspnetapp $JFROG_SERVICE/$JFROG_REPO_PATH/aspnetapp:stable docker push $JFROG_SERVICE/$JFROG_REPO_PATH/aspnetapp:stable - docker tag unity-grantmanager-dbmigrator $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator:stable - docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator:stable - docker tag unity-grantmanager-web $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web:stable - docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web:stable +# docker tag unity-grantmanager-dbmigrator $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator:stable +# docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator:stable +# docker tag unity-grantmanager-web $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web:stable +# docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web:stable - name: Disconnect docker from JFrog Artifactory run: | docker logout + - name: Install OpenShift CLI + run: | + curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz + tar -xvf oc.tar.gz + sudo mv oc /usr/local/bin + - name: Verify OpenShift CLI installation + run: oc version - name: Connect to OpenShift API non-interactive login using current session token run: | oc login --token=$OC_AUTH_TOKEN --server=$OC_CLUSTER @@ -201,10 +208,10 @@ jobs: docker push $OC_REGISTRY/$OC_TARGET_PROJECT/dotnetapp:stable docker tag aspnetapp $OC_REGISTRY/$OC_TARGET_PROJECT/aspnetapp:stable docker push $OC_REGISTRY/$OC_TARGET_PROJECT/aspnetapp:stable - docker tag unity-grantmanager-dbmigrator $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator:stable - docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator:stable - docker tag unity-grantmanager-web $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web:stable - docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web:stable +# docker tag unity-grantmanager-dbmigrator $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator:stable +# docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator:stable +# docker tag unity-grantmanager-web $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web:stable +# docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web:stable - name: Disconnect docker from OpenShift container registry run: | docker logout diff --git a/.github/workflows/docker-build-test.yml b/.github/workflows/docker-build-test.yml index aa3a6f1..8f0fb9d 100644 --- a/.github/workflows/docker-build-test.yml +++ b/.github/workflows/docker-build-test.yml @@ -147,12 +147,12 @@ jobs: - name: Build aspnetapp docker images run: docker compose build working-directory: ./applications/aspnetapp - - name: Build Docker images - run: | - rm -f ./docker-compose.override.yml - echo "buildArgs UNITY_BUILD_VERSION: ${{env.UGM_BUILD_VERSION}}, UNITY_BUILD_REVISION: ${{env.UGM_BUILD_REVISION}}" - docker compose build --build-arg UNITY_BUILD_VERSION=${{env.UGM_BUILD_VERSION}} --build-arg UNITY_BUILD_REVISION=${{env.UGM_BUILD_REVISION}} - working-directory: ./applications/Unity.GrantManager +# - name: Build Docker images +# run: | +# rm -f ./docker-compose.override.yml +# echo "buildArgs UNITY_BUILD_VERSION: ${{env.UGM_BUILD_VERSION}}, UNITY_BUILD_REVISION: ${{env.UGM_BUILD_REVISION}}" +# docker compose build --build-arg UNITY_BUILD_VERSION=${{env.UGM_BUILD_VERSION}} --build-arg UNITY_BUILD_REVISION=${{env.UGM_BUILD_REVISION}} +# working-directory: ./applications/Unity.GrantManager - name: Connect to JFrog Artifactory non-interactive login using --password-stdin run: | echo "$JFROG_PASSWORD" | docker login -u "$JFROG_USERNAME" --password-stdin $JFROG_SERVICE @@ -162,13 +162,20 @@ jobs: docker push $JFROG_SERVICE/$JFROG_REPO_PATH/dotnetapp docker tag aspnetapp $JFROG_SERVICE/$JFROG_REPO_PATH/aspnetapp docker push $JFROG_SERVICE/$JFROG_REPO_PATH/aspnetapp - docker tag unity-grantmanager-dbmigrator $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator - docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator - docker tag unity-grantmanager-web $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web - docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web +# docker tag unity-grantmanager-dbmigrator $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator +# docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator +# docker tag unity-grantmanager-web $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web +# docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web - name: Disconnect docker from JFrog Artifactory run: | docker logout + - name: Install OpenShift CLI + run: | + curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz + tar -xvf oc.tar.gz + sudo mv oc /usr/local/bin + - name: Verify OpenShift CLI installation + run: oc version - name: Connect to OpenShift API non-interactive login using current session token run: | oc login --token=$OC_AUTH_TOKEN --server=$OC_CLUSTER @@ -180,10 +187,10 @@ jobs: docker push $OC_REGISTRY/$OC_TARGET_PROJECT/dotnetapp docker tag aspnetapp $OC_REGISTRY/$OC_TARGET_PROJECT/aspnetapp docker push $OC_REGISTRY/$OC_TARGET_PROJECT/aspnetapp - docker tag unity-grantmanager-dbmigrator $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator - docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator - docker tag unity-grantmanager-web $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web - docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web +# docker tag unity-grantmanager-dbmigrator $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator +# docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator +# docker tag unity-grantmanager-web $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web +# docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web - name: Disconnect docker from OpenShift container registry run: | docker logout diff --git a/.github/workflows/manual-trigger.yml b/.github/workflows/manual-trigger.yml index 83dddb5..00d82d4 100644 --- a/.github/workflows/manual-trigger.yml +++ b/.github/workflows/manual-trigger.yml @@ -18,7 +18,7 @@ on: # The data type of the input type: string env: - TARGET_ENV: ${{ inputs.name }} + TARGET_ENV: ${{ inputs.name }} OC_CLUSTER: ${{ vars.OPENSHIFT_CLUSTER }} OC_REGISTRY: ${{ vars.OPENSHIFT_REGISTRY }} OC_AUTH_TOKEN: ${{ secrets.OPENSHIFT_TOKEN }} @@ -64,43 +64,49 @@ jobs: - name: Set buildArgs run: | echo "buildArgs UNITY_BUILD_VERSION: ${{env.UGM_BUILD_VERSION}}, UNITY_BUILD_REVISION: ${{env.UGM_BUILD_REVISION}}" - - name: Build Docker images - run: | - rm -f ./docker-compose.override.yml - docker compose build --build-arg UNITY_BUILD_VERSION=${{env.UGM_BUILD_VERSION}} --build-arg UNITY_BUILD_REVISION=${{env.UGM_BUILD_REVISION}} - working-directory: ./applications/Unity.GrantManager - +# - name: Build Docker images +# run: | +# rm -f ./docker-compose.override.yml +# docker compose build --build-arg UNITY_BUILD_VERSION=${{env.UGM_BUILD_VERSION}} --build-arg UNITY_BUILD_REVISION=${{env.UGM_BUILD_REVISION}} +# working-directory: ./applications/Unity.GrantManager - name: Connect to JFrog Artifactory non-interactive login using --password-stdin run: | echo "$JFROG_PASSWORD" | docker login -u "$JFROG_USERNAME" --password-stdin $JFROG_SERVICE - name: Push application images to Artifactory container registry - run: | + run: | docker tag dotnetapp $JFROG_SERVICE/$JFROG_REPO_PATH/dotnetapp docker push $JFROG_SERVICE/$JFROG_REPO_PATH/dotnetapp docker tag aspnetapp $JFROG_SERVICE/$JFROG_REPO_PATH/aspnetapp docker push $JFROG_SERVICE/$JFROG_REPO_PATH/aspnetapp - docker tag unity-grantmanager-dbmigrator $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator - docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator - docker tag unity-grantmanager-web $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web - docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web +# docker tag unity-grantmanager-dbmigrator $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator +# docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-dbmigrator +# docker tag unity-grantmanager-web $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web +# docker push $JFROG_SERVICE/$JFROG_REPO_PATH/unity-grantmanager-web - name: Disconnect docker from JFrog Artifactory run: | docker logout + - name: Install OpenShift CLI + run: | + curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz + tar -xvf oc.tar.gz + sudo mv oc /usr/local/bin + - name: Verify OpenShift CLI installation + run: oc version - name: Connect to OpenShift API non-interactive login using current session token run: | oc login --token=$OC_AUTH_TOKEN --server=$OC_CLUSTER oc registry login docker login -u unused -p $(oc whoami -t) $OC_REGISTRY - name: Push application images to OpenShift container registry - run: | + run: | docker tag dotnetapp $OC_REGISTRY/$OC_TARGET_PROJECT/dotnetapp docker push $OC_REGISTRY/$OC_TARGET_PROJECT/dotnetapp docker tag aspnetapp $OC_REGISTRY/$OC_TARGET_PROJECT/aspnetapp docker push $OC_REGISTRY/$OC_TARGET_PROJECT/aspnetapp - docker tag unity-grantmanager-dbmigrator $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator - docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator - docker tag unity-grantmanager-web $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web - docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web +# docker tag unity-grantmanager-dbmigrator $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator +# docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-dbmigrator +# docker tag unity-grantmanager-web $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web +# docker push $OC_REGISTRY/$OC_TARGET_PROJECT/unity-grantmanager-web - name: Disconnect docker from OpenShift container registry run: | docker logout