Skip to content

Commit

Permalink
Fixing oc CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
DarylTodosichuk committed Dec 23, 2024
1 parent 57ac6b5 commit 605effb
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 45 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/docker-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
35 changes: 21 additions & 14 deletions .github/workflows/docker-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
40 changes: 23 additions & 17 deletions .github/workflows/manual-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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

0 comments on commit 605effb

Please sign in to comment.