-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
858 changed files
with
10,389 additions
and
8,629 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,9 @@ on: | |
env: | ||
IMAGE_NAME: diam-admin-frontend | ||
WORKING_DIRECTORY: ./diam-admin-ui | ||
|
||
BRANCH_NAME: develop | ||
VALUES_FILE: dev | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -19,6 +21,28 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set environment for branch | ||
run: | | ||
if [[ ${{ github.ref_name }} == 'main' ]]; then | ||
echo "BRANCH_NAME=main" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=prod" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'test' ]]; then | ||
echo "BRANCH_NAME=test" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=test" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'develop' ]]; then | ||
echo "BRANCH_NAME=develop" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=dev" >> "$GITHUB_ENV" | ||
fi | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
- name: Branch name | ||
run: echo running on branch ${GITHUB_REF##*/} | ||
|
||
|
@@ -37,3 +61,57 @@ jobs: | |
- name: Docker Push to Artifactory | ||
run: | | ||
docker push artifacts.developer.gov.bc.ca/de27-general-docker/${{env.IMAGE_NAME}}:${GITHUB_REF##*/} | ||
- name: Checkout ArgoCD Repo | ||
id: gitops | ||
if: steps.publish.outcome == 'success' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: bcgov-c/tenant-gitops-e27db1 | ||
ref: ${{ env.BRANCH_NAME }} | ||
token: ${{ secrets.ARGO_PAT }} # access token | ||
path: gitops | ||
|
||
- name: Get short SHA | ||
id: short_sha | ||
run: | | ||
echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" | ||
echo "Short SHA: $SHORT_SHA" | ||
- name: Update Helm Dev Values and Commit | ||
id: helm | ||
if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful | ||
run: | | ||
echo "Updating ${{ env.BRANCH_NAME }} helm values to trigger ArgoCD deployment " | ||
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test | ||
cd gitops/charts | ||
# Update the Helm values file with the new image tag and version | ||
DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time | ||
echo "Updating tag apitag: to ${{ steps.short_sha.outputs.SHORT_SHA }}" | ||
sed -i "s/apitag: .*/apitag: ${{ env.VALUES_FILE }}-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml | ||
sed -i "s/apitag: .*/apitag: ${{ env.VALUES_FILE }}-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" admin-frontend/values.yaml | ||
|
||
# Commit and push the changes | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
|
||
git add . | ||
|
||
git add ../deploy/${{ env.VALUES_FILE }}_values.yaml | ||
|
||
# Repackage Helm Chart | ||
|
||
cd admin-frontend | ||
|
||
helm dependency build | ||
|
||
git add . | ||
|
||
git commit -m "Update ${{ env.BRANCH_NAME }} API image tag" | ||
git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,16 @@ name: diam-approvalflow | |
|
||
on: | ||
push: | ||
branches: [develop,test,main] | ||
branches: [develop,test,main] | ||
paths: | ||
- "backend/ApprovalFlow/**" | ||
- ".github/workflows/build-push-approvalflow.yml" | ||
workflow_dispatch: | ||
env: | ||
IMAGE_NAME: diam-approvalflow | ||
WORKING_DIRECTORY: ./backend | ||
BRANCH_NAME: develop | ||
VALUES_FILE: dev | ||
|
||
jobs: | ||
build: | ||
|
@@ -19,6 +21,28 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set environment for branch | ||
run: | | ||
if [[ ${{ github.ref_name }} == 'main' ]]; then | ||
echo "BRANCH_NAME=main" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=prod" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'test' ]]; then | ||
echo "BRANCH_NAME=test" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=test" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'develop' ]]; then | ||
echo "BRANCH_NAME=develop" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=dev" >> "$GITHUB_ENV" | ||
fi | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
- name: Branch name | ||
run: echo running on branch ${GITHUB_REF##*/} | ||
|
||
|
@@ -37,23 +61,31 @@ jobs: | |
- name: Docker Push to Artifactory | ||
run: | | ||
docker push artifacts.developer.gov.bc.ca/de27-general-docker/${{env.IMAGE_NAME}}:${GITHUB_REF##*/} | ||
- name: Get short SHA | ||
id: short_sha | ||
run: | | ||
echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" | ||
echo "Short SHA: $SHORT_SHA" | ||
- name: Checkout ArgoCD Repo | ||
id: gitops | ||
if: steps.publish.outcome == 'success' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: bcgov-c/tenant-gitops-e27db1 | ||
ref: develop | ||
ref: ${{ env.BRANCH_NAME }} | ||
token: ${{ secrets.ARGO_PAT }} # access token | ||
path: gitops | ||
|
||
|
||
- name: Update Helm Values and Commit | ||
id: helm | ||
if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful | ||
id: helm-dev | ||
if: github.ref == 'refs/heads/develop' && steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful | ||
run: | | ||
echo "Updating helm values to trigger ArgoCD deployment " | ||
echo "Updating ${{ env.BRANCH_NAME }} helm values to trigger ArgoCD deployment" | ||
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test | ||
cd gitops/charts | ||
|
@@ -62,16 +94,16 @@ jobs: | |
DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time | ||
echo "Updating tag apitag: to ${{ steps.short_sha.outputs.SHORT_SHA }}" | ||
sed -i "s/apitag: .*/apitag: dev-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/dev_values.yaml | ||
sed -i "s/apitag: .*/apitag: dev-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" approvalflow/values.yaml | ||
sed -i "s/apitag: .*/apitag: ${{ env.VALUES_FILE }}-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml | ||
sed -i "s/apitag: .*/apitag: ${{ env.VALUES_FILE }}-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" approvalflow/values.yaml | ||
# Commit and push the changes | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git add . | ||
git add ../deploy/dev_values.yaml | ||
git add ../deploy/${{ env.VALUES_FILE }}_values.yaml | ||
# Repackage Helm Chart | ||
|
@@ -81,6 +113,7 @@ jobs: | |
git add . | ||
git commit -m "Update Dev API image tag" | ||
git push origin develop # Update the branch name as needed | ||
git commit -m "Update ${{ env.BRANCH_NAME }} API image tag" | ||
git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,16 @@ name: diam-casemanagement | |
|
||
on: | ||
push: | ||
branches: [develop,test,main] | ||
branches: [develop,test,main] | ||
paths: | ||
- "backend/edt.casemanagement/**" | ||
- ".github/workflows/build-push-casemanagement.yml" | ||
workflow_dispatch: | ||
env: | ||
IMAGE_NAME: diam-casemanagement | ||
WORKING_DIRECTORY: ./backend | ||
BRANCH_NAME: develop | ||
VALUES_FILE: dev | ||
|
||
jobs: | ||
build: | ||
|
@@ -18,6 +20,28 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set environment for branch | ||
run: | | ||
if [[ ${{ github.ref_name }} == 'main' ]]; then | ||
echo "BRANCH_NAME=main" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=prod" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'test' ]]; then | ||
echo "BRANCH_NAME=test" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=test" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'develop' ]]; then | ||
echo "BRANCH_NAME=develop" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=dev" >> "$GITHUB_ENV" | ||
fi | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
- name: Branch name | ||
run: echo running on branch ${GITHUB_REF##*/} | ||
|
@@ -38,22 +62,28 @@ jobs: | |
run: | | ||
docker push artifacts.developer.gov.bc.ca/de27-general-docker/${{env.IMAGE_NAME}}:${GITHUB_REF##*/} | ||
- name: Get short SHA | ||
id: short_sha | ||
run: | | ||
echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)" | ||
echo "Short SHA: $SHORT_SHA" | ||
- name: Checkout ArgoCD Repo | ||
id: gitops | ||
if: steps.publish.outcome == 'success' | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: bcgov-c/tenant-gitops-e27db1 | ||
ref: develop | ||
ref: ${{ env.BRANCH_NAME }} | ||
token: ${{ secrets.ARGO_PAT }} # access token | ||
path: gitops | ||
|
||
- name: Update Helm Values and Commit | ||
id: helm | ||
if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful | ||
if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful | ||
run: | | ||
echo "Updating helm values to trigger ArgoCD deployment " | ||
echo "Updating ${{ env.VALUES_FILE }} helm values to trigger ArgoCD deployment " | ||
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test | ||
cd gitops/charts | ||
|
@@ -62,16 +92,16 @@ jobs: | |
DATETIME=$(date +'%Y-%m-%d %H:%M:%S') # Get current date and time | ||
echo "Updating tag apitag: to ${{ steps.short_sha.outputs.SHORT_SHA }}" | ||
sed -i "s/apitag: .*/apitag: dev-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/dev_values.yaml | ||
sed -i "s/apitag: .*/apitag: dev-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" edt-casemgmt/values.yaml | ||
sed -i "s/apitag: .*/apitag: ${{ env.VALUES_FILE }}-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" ../deploy/${{ env.VALUES_FILE }}_values.yaml | ||
sed -i "s/apitag: .*/apitag: ${{ env.VALUES_FILE }}-${{ steps.short_sha.outputs.SHORT_SHA }} # Image Updated on $DATETIME/" edt-casemgmt/values.yaml | ||
# Commit and push the changes | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "GitHub Actions" | ||
git add . | ||
git add ../deploy/dev_values.yaml | ||
git add ../deploy/${{ env.VALUES_FILE }}_values.yaml | ||
# Repackage Helm Chart | ||
|
@@ -81,6 +111,9 @@ jobs: | |
git add . | ||
git commit -m "Update Dev API image tag" | ||
git push origin develop # Update the branch name as needed | ||
git commit -m "Update ${{ env.BRANCH_NAME }} API image tag" | ||
git push origin ${{ env.BRANCH_NAME }} # Update the branch name as needed | ||
Oops, something went wrong.