Skip to content

Commit

Permalink
Merge pull request #42 from bcgov/dev
Browse files Browse the repository at this point in the history
Update workflow builds
  • Loading branch information
DarylTodosichuk authored Sep 24, 2024
2 parents f00af2b + 1093395 commit d552106
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/docker-build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ env:
JFROG_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
JFROG_REPO_PATH: ${{ vars.ARTIFACTORY_REPO }}
JFROG_SERVICE: ${{ vars.ARTIFACTORY_SERVICE }}
UGM_BUILD_VERSION: ${{vars.UGM_BUILD_VERSION}}
UGM_BUILD_REVISION: ${{vars.UGM_BUILD_REVISION}}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down Expand Up @@ -56,6 +58,18 @@ jobs:
- name: Build aspnetapp docker images
run: docker compose build
working-directory: ./applications/aspnetapp
- name: Get BuildId
id: commit
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- 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: 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 @@ -65,6 +79,10 @@ 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
- name: Disconnect docker from JFrog Artifactory
run: |
docker logout
Expand All @@ -79,6 +97,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
- name: Disconnect docker from OpenShift container registry
run: |
docker logout
24 changes: 23 additions & 1 deletion .github/workflows/docker-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ env:
JFROG_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
JFROG_REPO_PATH: ${{ vars.ARTIFACTORY_REPO }}
JFROG_SERVICE: ${{ vars.ARTIFACTORY_SERVICE }}
UGM_BUILD_VERSION: ${{vars.UGM_BUILD_VERSION}}
UGM_BUILD_REVISION: ${{vars.UGM_BUILD_REVISION}}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down Expand Up @@ -56,6 +58,18 @@ jobs:
- name: Build aspnetapp docker images
run: docker compose build
working-directory: ./applications/aspnetapp
- name: Get BuildId
id: commit
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- 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: 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 @@ -65,6 +79,10 @@ 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
- name: Disconnect docker from JFrog Artifactory
run: |
docker logout
Expand All @@ -79,6 +97,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
- name: Disconnect docker from OpenShift container registry
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
22 changes: 22 additions & 0 deletions .github/workflows/docker-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ env:
JFROG_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
JFROG_REPO_PATH: ${{ vars.ARTIFACTORY_REPO }}
JFROG_SERVICE: ${{ vars.ARTIFACTORY_SERVICE }}
UGM_BUILD_VERSION: ${{vars.UGM_BUILD_VERSION}}
UGM_BUILD_REVISION: ${{vars.UGM_BUILD_REVISION}}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down Expand Up @@ -56,6 +58,18 @@ jobs:
- name: Build aspnetapp docker images
run: docker compose build
working-directory: ./applications/aspnetapp
- name: Get BuildId
id: commit
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- 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: 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 @@ -65,6 +79,10 @@ 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
- name: Disconnect docker from JFrog Artifactory
run: |
docker logout
Expand All @@ -79,6 +97,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
- name: Disconnect docker from OpenShift container registry
run: |
docker logout
2 changes: 1 addition & 1 deletion docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

name: local
# Add docker runtime environment variables from the .env file these are not included in the docker builds.
services:
web-application:
Expand Down

0 comments on commit d552106

Please sign in to comment.