Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add backup.yaml file #15

Open
wants to merge 38 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
63b5859
Create backup.yaml
JonTaylorBCGov2 May 22, 2024
60b1a18
Add backup.yaml
JonTaylor1971 May 22, 2024
844714e
merged change
JonTaylor1971 May 22, 2024
8f9b761
Create schema-spy.yaml
JonTaylorBCGov2 May 22, 2024
fc91340
Update api-buildandpush.yaml
JonTaylorBCGov2 May 28, 2024
8e66ae9
Update api-buildandpush.yaml
JonTaylorBCGov2 May 28, 2024
01039c0
Update api-buildandpush.yaml
JonTaylorBCGov2 May 28, 2024
7f9a7bf
Update api-buildandpush.yaml
JonTaylorBCGov2 May 28, 2024
9250afe
Update web-buildandpush.yaml
JonTaylorBCGov2 May 28, 2024
b3f504a
Update app-vue.yml
JonTaylorBCGov2 May 28, 2024
de54b0e
Update app-vue.yml
JonTaylorBCGov2 May 28, 2024
181e1eb
Create Dockerfile.node
JonTaylorBCGov2 May 28, 2024
9923874
Update app-vue.yml
JonTaylorBCGov2 May 28, 2024
ccb54cc
Update backup.yaml
JonTaylorBCGov2 May 28, 2024
7631160
Update backup.yaml
JonTaylorBCGov2 May 28, 2024
c978b4a
Update schema-spy.yaml
JonTaylorBCGov2 May 29, 2024
f427007
Create web.yaml
JonTaylorBCGov2 May 29, 2024
b62a8c0
Update web.yaml
JonTaylorBCGov2 May 29, 2024
7578f83
Update web.yaml
JonTaylorBCGov2 May 29, 2024
862ff49
Update web.yaml
JonTaylorBCGov2 May 29, 2024
15c5573
Update web.yaml
JonTaylorBCGov2 May 29, 2024
24a3750
Update Dockerfile.node
JonTaylorBCGov2 Jun 21, 2024
336b26a
Update Dockerfile.node
JonTaylorBCGov2 Jun 21, 2024
9bd961a
Update Dockerfile.node
JonTaylorBCGov2 Jun 21, 2024
340fd54
Update Dockerfile.node
JonTaylorBCGov2 Jun 21, 2024
fd19851
Update Dockerfile.node
JonTaylorBCGov2 Jun 21, 2024
71b7830
Update web.yaml
JonTaylorBCGov2 Jul 3, 2024
d235dbe
Update api-buildandpush.yaml
JonTaylorBCGov2 Jul 3, 2024
bd5beff
Update Dockerfile.node
JonTaylorBCGov2 Jul 5, 2024
3222ed6
Update Dockerfile
JonTaylorBCGov2 Jul 5, 2024
11cb700
Update web.yaml
JonTaylorBCGov2 Jul 5, 2024
28cfad8
Update XForwardedForHelper.cs
JonTaylorBCGov2 Jul 5, 2024
1e57df3
Update Dockerfile
JonTaylorBCGov2 Jul 11, 2024
de8234c
update XForwardedForHelper for forwardport 8080
JonTaylor1971 Jul 12, 2024
fddb8e7
Enable Npgsql.EnableLegacyTimestampBehavior
WadeBarnes Jul 12, 2024
5583d49
Merge pull request #1 from WadeBarnes/npgsql-enable-legacy-timestamp-…
JonTaylorBCGov2 Jul 12, 2024
d4f9263
Update XForwardedForHelper.cs
JonTaylorBCGov2 Jul 12, 2024
cdeec5d
Update XForwardedForHelper.cs
JonTaylorBCGov2 Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 33 additions & 18 deletions .github/workflows/api-buildandpush.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,48 @@ jobs:
echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)"
echo "Short SHA: $SHORT_SHA"

# - name: Install dependencies
# run: dotnet restore
# working-directory: ${{env.WORKING_DIRECTORY}}

# - name: Build
# run: dotnet build --configuration Release --no-restore
# working-directory: ${{env.WORKING_DIRECTORY}}

# - name: Test
# run: dotnet test --no-restore --verbosity normal
# working-directory: ${{env.WORKING_DIRECTORY}}

# - name: Push to Artifactory
# id: publish
# run: dotnet push artifacts.developer.gov.bc.ca/cac1-cas-api/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}

- name: Docker Build Backend Image
working-directory: ${{env.WORKING_DIRECTORY}}
run: |
docker build --tag api . --file api/Dockerfile
docker tag api artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}
# docker compose build backend
# docker tag cas-api artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}

- name: Docker Push to Artifactory
id: publish
# if: github.repository_owner == 'bcgov-c'
run: |
docker push artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}

- name: Checkout ArgoCD Repo
id: gitops
uses: actions/checkout@v4
with:
repository: bcgov-c/tenant-gitops-ac1cc8
ref: develop
token: ${{ secrets.GIT_OPS_SSH_KEY }} # `GH_PAT` is a secret that contains your PAT
path: gitops

- name: Update Helm Values and Commit
id: helm
if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful
run: |
# Clone the GitOps deployment configuration repository
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test and
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

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/" api/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 commit -m "Update Dev Api image tag"
git push origin develop # Update the branch name as needed
79 changes: 61 additions & 18 deletions .github/workflows/app-vue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ jobs:
node-version: [10.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
working-directory: ${{env.working-directory}}
- run: npm run build --if-present --tag web
working-directory: ${{env.working-directory}}
# - uses: actions/checkout@v2
# - name: Use Node.js ${{ matrix.node-version }}
# uses: actions/setup-node@v1
# with:
# node-version: ${{ matrix.node-version }}
# - run: npm ci
# working-directory: ${{env.working-directory}}
# - run: npm run build --if-present --tag web
# working-directory: ${{env.working-directory}}

- name: Login to Artifactory
uses: docker/login-action@v1
Expand All @@ -39,22 +39,65 @@ jobs:
username: ${{ secrets.CAS_ARTIFACTORY_USERNAME }}
password: ${{ secrets.CAS_ARTIFACTORY_PASSWORD }}

- name: Checkout Repo
uses: actions/checkout@v4

# Get SHORT_SHA to tag images
- 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: Docker Build Backend Image
working-directory: ${{env.working-directory}}
run: |
docker build --tag web . --file Dockerfile
docker tag web artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}
# - name: Docker Build Backend Image
# working-directory: ${{env.working-directory}}
# run: |
# docker build --tag web . --file Dockerfile
# docker tag web artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}

- name: Docker Push to Artifactory
id: publish
run: |
# - name: Docker Push to Artifactory
# id: publish
# run: |
# docker push artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}

- name: Docker Build Image
run: |
docker build --tag nginx-runtime -f docker/nginx-runtime/Dockerfile ./docker/nginx-runtime/
cd web
docker build --tag ss-web-artifacts -f Dockerfile.node . --build-arg WEB_BASE_HREF=${{ secrets.WEB_BASE_HREF }}
cd ..
docker build --tag web -f docker/vue-on-nginx/Dockerfile ./docker/vue-on-nginx/
docker tag web artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}
docker push artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}


- name: Checkout ArgoCD Repo
id: gitops
uses: actions/checkout@v4
with:
repository: bcgov-c/tenant-gitops-ac1cc8
ref: develop
token: ${{ secrets.GIT_OPS_SSH_KEY }} # `GH_PAT` is a secret that contains your PAT
path: gitops

- name: Update Helm Values and Commit
id: helm
if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful
run: |
# Clone the GitOps deployment configuration repository
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test and
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

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/" web/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
71 changes: 71 additions & 0 deletions .github/workflows/backup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Backup

on:
workflow_dispatch:
env:
IMAGE_NAME: backup
WORKING_DIRECTORY: ./
jobs:
build:
runs-on: ubuntu-latest

steps:

- name: Login to Artifactory
uses: docker/login-action@v1
with:
registry: artifacts.developer.gov.bc.ca
username: ${{ secrets.CAS_ARTIFACTORY_USERNAME }}
password: ${{ secrets.CAS_ARTIFACTORY_PASSWORD }}

- name: Checkout Schema Spy Repo
uses: actions/checkout@v4
with:
repository: BCDevOps/backup-container.git
ref: master

# Get SHORT_SHA to tag images
- 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: Docker Build Backup Image
run: |
cd docker
docker build --tag ${{ env.IMAGE_NAME }} .
docker tag ${{ env.IMAGE_NAME }} artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}
docker push artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}

- name: Checkout ArgoCD Repo
id: gitops
uses: actions/checkout@v4
with:
repository: bcgov-c/tenant-gitops-ac1cc8
ref: develop
token: ${{ secrets.GIT_OPS_SSH_KEY }} # `GH_PAT` is a secret that contains your PAT
path: gitops

- name: Update Helm Values and Commit
id: helm
if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful
run: |
# Clone the GitOps deployment configuration repository
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test and
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

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/" backup/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
70 changes: 70 additions & 0 deletions .github/workflows/schema-spy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Schema-Spy

on:
workflow_dispatch:
env:
IMAGE_NAME: schema-spy
WORKING_DIRECTORY: ./
jobs:
build:
runs-on: ubuntu-latest

steps:

- name: Login to Artifactory
uses: docker/login-action@v1
with:
registry: artifacts.developer.gov.bc.ca
username: ${{ secrets.CAS_ARTIFACTORY_USERNAME }}
password: ${{ secrets.CAS_ARTIFACTORY_PASSWORD }}

- name: Checkout Schema Spy Repo
uses: actions/checkout@v4
with:
repository: bcgov/SchemaSpy.git
ref: master

# Get SHORT_SHA to tag images
- 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: Docker Build Schema Spy Image
run: |
docker build --tag ${{ env.IMAGE_NAME }} .
docker tag ${{ env.IMAGE_NAME }} artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}
docker push artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}

- name: Checkout ArgoCD Repo
id: gitops
uses: actions/checkout@v4
with:
repository: bcgov-c/tenant-gitops-ac1cc8
ref: develop
token: ${{ secrets.GIT_OPS_SSH_KEY }} # `GH_PAT` is a secret that contains your PAT
path: gitops

- name: Update Helm Values and Commit
id: helm
if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful
run: |
# Clone the GitOps deployment configuration repository
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test and
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

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/" schema-spy/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
71 changes: 42 additions & 29 deletions .github/workflows/web-buildandpush.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,39 +31,52 @@ jobs:
- run: npm run build --if-present
working-directory: ${{env.working-directory}}

# # Get SHORT_SHA to tag images
# - 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: Install dependencies
# run: dotnet restore
# working-directory: ${{env.WORKING_DIRECTORY}}

# - name: Build
# run: dotnet build --configuration Release --no-restore
# working-directory: ${{env.WORKING_DIRECTORY}}

# - name: Test
# run: dotnet test --no-restore --verbosity normal
# working-directory: ${{env.WORKING_DIRECTORY}}

# - name: Push to Artifactory
# id: publish
# run: dotnet push artifacts.developer.gov.bc.ca/cac1-cas-api/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}
# Get SHORT_SHA to tag images
- 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: Docker Build Backend Image
# working-directory: ${{env.WORKING_DIRECTORY}}web/
# run: |
# docker build --tag web .
# docker tag web artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}
# # docker compose build backend
# # docker tag cas-web artifacts.developer.gov.bc.ca/cac1-cas-web/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}
- name: Docker Build Web Image
working-directory: ${{env.WORKING_DIRECTORY}}web/
run: |
docker build --tag web . --file web/Dockerfile
docker tag web artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}

- name: Docker Push to Artifactory
id: publish
run: |
docker push artifacts.developer.gov.bc.ca/cac1-cas/${{ env.IMAGE_NAME }}:dev-${{ steps.short_sha.outputs.SHORT_SHA }}

- name: Checkout ArgoCD Repo
id: gitops
uses: actions/checkout@v4
with:
repository: bcgov-c/tenant-gitops-ac1cc8
ref: develop
token: ${{ secrets.GIT_OPS_SSH_KEY }} # `GH_PAT` is a secret that contains your PAT
path: gitops

- name: Update Helm Values and Commit
id: helm
if: steps.gitops.outcome == 'success' # Only run if the previous step (publish) was successful
run: |
# Clone the GitOps deployment configuration repository
# Navigate to the directory containing your Helm values file for the environment develop -> DEV, test -> test and
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

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/" web/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
Loading
Loading