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

PIDP-637 - init commit for dev helm deploys #260

Merged
merged 43 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
48b5d52
PIDP-637 - init commit for dev helm deploys
Jul 6, 2023
b80c616
Merge branch 'develop' into PIDP-637
Jul 6, 2023
5eb6b27
PIDP-637 - add pr stanza for testing
Jul 6, 2023
2147dc7
Merge branch 'PIDP-637' of https://github.com/bcgov/moh-pidp into PID…
Jul 6, 2023
79e5b5f
PIDP-637 - add prereq for helm install job
Jul 6, 2023
a726415
PIDP-637 - add prereq for helm install job
Jul 10, 2023
1f5a248
Merge branch 'develop' into PIDP-637
Jul 10, 2023
bfc84a6
PIDP-637 - remove code snippet
Jul 10, 2023
d0538dd
Merge branch 'PIDP-637' of https://github.com/bcgov/moh-pidp into PID…
Jul 10, 2023
537271f
PIDP-637 - update token and server url
Jul 10, 2023
5df160e
PIDP-637 - update charts dir
Jul 10, 2023
beaca62
PIDP-637 - update charts dir
Jul 11, 2023
3e08b0b
PIDP-637 - update absolute path
Jul 11, 2023
9a157c4
PIDP-637 - use built in gha
Jul 11, 2023
98cb302
PIDP-637 - use built in gha - adjust formatting
Jul 11, 2023
e979920
PIDP-637 - adjust version of deliverybot
Jul 11, 2023
af72e22
PIDP-637 - adjust version of chart
Jul 11, 2023
19cbf5b
PIDP-637 - adjust version of chart
Jul 11, 2023
591077b
Merge branch 'develop' into PIDP-637
Jul 11, 2023
5d39002
PIDP-637 - adjust version of chart
Jul 11, 2023
f672d2e
PIDP-637 - adjust dir
Jul 11, 2023
f253b4d
PIDP-637 - adjust dir for deploy values
Jul 11, 2023
930be87
PIDP-637 - adjust dir for deploy values
Jul 11, 2023
76f3904
PIDP-637 - add source code checkout
Jul 11, 2023
b7144f1
PIDP-637 - add source code checkout for webapi and plr-intake, add te…
Jul 11, 2023
187ac9a
PIDP-637 - remove duplicate file
Jul 11, 2023
52a3180
PIDP-637 - separate helm install into script
Jul 11, 2023
b0b6590
PIDP-637 - remove concurrency, duplicate file
Jul 11, 2023
309e2f1
PIDP-637 - remove workflow call
Jul 11, 2023
2eaf4f0
PIDP-637 - remove workflow call
Jul 11, 2023
a8ef50e
PIDP-637 - update helm charts, build scripts
Jul 12, 2023
6989e87
PIDP-637 - add dev deploy helm
Jul 12, 2023
261f82d
PIDP-637 - add pr stanza to trigger
Jul 12, 2023
6f12edd
Merge branch 'develop' into PIDP-637
Jul 12, 2023
9d162f1
PIDP-637 - change image tag
Jul 12, 2023
cf98a64
Merge branch 'PIDP-637' of https://github.com/bcgov/moh-pidp into PID…
Jul 12, 2023
acb533c
PIDP-637 - remove pr stanza from helm deploy
Jul 12, 2023
457182a
PIDP-637 - add namespace to image trigger
Jul 12, 2023
aee8ac3
PIDP-637 - remove pr stanza
Jul 12, 2023
796430f
PIDP-637 - update build scripts with appropriate triggers
Jul 12, 2023
23fa246
PIDP-637 - remove pr stanza triggers, add demo helm install script
Jul 12, 2023
954205c
PIDP-637 - add values files push triggers for helm install
Jul 12, 2023
aa28172
Merge branch 'develop' into PIDP-637
Jul 12, 2023
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
20 changes: 20 additions & 0 deletions .github/workflows/build-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,23 @@ jobs:
- name: "Push image"
run: |
docker push image-registry.apps.silver.devops.gov.bc.ca/d8a8f9-tools/pidp-frontend:chris



# runs-on: 'ubuntu-latest'
# needs: [build-and-deploy-frontend]
# steps:
# - name: 'Deploy'
# uses: 'deliverybot/helm@v1'
# with:
# # Task remove means to remove the helm release.
# task: 'remove'
# release: 'review-myapp-${{ github.event.pull_request.number }}'
# version: '${{ github.sha }}'
# track: 'stable'
# chart: 'app'
# namespace: 'example-helm'
# token: '${{ github.token }}'
# env:
# KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}'

36 changes: 36 additions & 0 deletions .github/workflows/demo-deploy_helm_chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy Helm Charts - Test

# Keeping this manual so changes can be verified in production before deploying
on:
# push:
# branches: [main]
# paths:
# - "charts/**"
workflow_dispatch:

# This will terminate builds that are previously, but continuing to run. Saves GHA hours.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

helm-deployment:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v1

- name: Authenticate and set context
uses: redhat-actions/oc-login@v1.1
with:
openshift_server_url: ${{secrets.OPENSHIFT_CLUSTER_URL}}
openshift_token: ${{secrets.OPENSHIFT_TOKEN}}
namespace: d8a8f9-test

- name: Helm Deploy / install command
run: |
echo current installed helm releases
helm list --namespace d8a8f9-test

echo installing helm chart...
helm upgrade --wait --values ./deploy/demo_values.yaml --namespace d8a8f9-test demo charts/pidp --debug
53 changes: 53 additions & 0 deletions .github/workflows/dev-build-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build Frontend - Dev

on:
push:
branches: [develop]
paths:
- "workspace/**"
workflow_dispatch:

# This will terminate builds that are previously, but continuing to run. Saves GHA hours.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-deploy-frontend:
name: Frontend Build and Deploy
runs-on: ubuntu-latest
defaults:
run:
working-directory: "./workspace"
steps:
- name: "Checkout Code"
uses: actions/checkout@master

- name: Use Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: 16.x

- name: YARN Install
run: |
yarn install

- name: YARN Build
run: |
yarn build

- name: "Docker Build"
run: |
docker build -t image-registry.apps.silver.devops.gov.bc.ca/d8a8f9-tools/pidp-frontend:develop .

# Uses the builder service account token
- name: "Docker Login to Silver OCP"
uses: docker/login-action@v2
with:
registry: image-registry.apps.silver.devops.gov.bc.ca
username: builder
password: ${{ secrets.SILVER_TOOLS_BUILDER_TOKEN }}

- name: "Push image"
run: |
docker push image-registry.apps.silver.devops.gov.bc.ca/d8a8f9-tools/pidp-frontend:develop
41 changes: 41 additions & 0 deletions .github/workflows/dev-build-plr-intake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build PLR-Intake Backend - Dev

on:
push:
branches: [develop]
paths:
- "backend/services.plr-intake/**"
- "backend/services.plr-intake.tests/**"
workflow_dispatch:

# This will terminate builds that are previously, but continuing to run. Saves GHA hours.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-deploy-plr-intake:
name: PLR Intake Backend Build and Deploy
runs-on: ubuntu-latest
defaults:
run:
working-directory: "./backend/services.plr-intake"
steps:
- name: "Checkout Code"
uses: actions/checkout@master

- name: "Docker Build"
run: |
docker build -t image-registry.apps.silver.devops.gov.bc.ca/d8a8f9-tools/pidp-plr-intake:develop .

# Uses the builder service account token
- name: "Docker Login to Silver OCP"
uses: docker/login-action@v2
with:
registry: image-registry.apps.silver.devops.gov.bc.ca
username: builder
password: ${{ secrets.SILVER_TOOLS_BUILDER_TOKEN }}

- name: "Push image"
run: |
docker push image-registry.apps.silver.devops.gov.bc.ca/d8a8f9-tools/pidp-plr-intake:develop
41 changes: 41 additions & 0 deletions .github/workflows/dev-build-webapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build WebAPI - Dev

on:
push:
branches: [develop]
paths:
- "backend/webapi/**"
- "backend/webapi.tests/**"
workflow_dispatch:

# This will terminate builds that are previously, but continuing to run. Saves GHA hours.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-and-deploy-webapi:
name: WebAPI Backend Build and Deploy
runs-on: ubuntu-latest
defaults:
run:
working-directory: "./backend/webapi"
steps:
- name: "Checkout Code"
uses: actions/checkout@master

- name: "Docker Build"
run: |
docker build -t image-registry.apps.silver.devops.gov.bc.ca/d8a8f9-tools/pidp-webapi:develop .

# Uses the builder service account token
- name: "Docker Login to Silver OCP"
uses: docker/login-action@v2
with:
registry: image-registry.apps.silver.devops.gov.bc.ca
username: builder
password: ${{ secrets.SILVER_TOOLS_BUILDER_TOKEN }}

- name: "Push image"
run: |
docker push image-registry.apps.silver.devops.gov.bc.ca/d8a8f9-tools/pidp-webapi:develop
35 changes: 35 additions & 0 deletions .github/workflows/dev-deploy_helm_chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy Helm Charts - Dev

on:
push:
branches: [develop]
paths:
- "charts/**"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding this as well: /deploy/dev_values.yaml

workflow_dispatch:

# This will terminate builds that are previously, but continuing to run. Saves GHA hours.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

helm-deployment:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v1

- name: Authenticate and set context
uses: redhat-actions/oc-login@v1.1
with:
openshift_server_url: ${{secrets.OPENSHIFT_CLUSTER_URL}}
openshift_token: ${{secrets.OPENSHIFT_TOKEN}}
namespace: d8a8f9-dev

- name: Helm Deploy / install command
run: |
echo current installed helm releases
helm list --namespace d8a8f9-dev

echo installing helm chart...
helm upgrade --wait --values ./deploy/dev_values.yaml --namespace d8a8f9-dev dev charts/pidp --debug
37 changes: 37 additions & 0 deletions .github/workflows/main-build-frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build Frontend

on:
push:
branches: [main]
paths:
- "workspace/**"
workflow_dispatch:

env:
ORIG_TAG: test
PROMOTE_TAG: main

# This will terminate builds that are previously, but continuing to run. Saves GHA hours.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
promote-image-to-prod:
name: WebAPI Backend Promote to prod
runs-on: ubuntu-latest
steps:
- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.7"

- name: oc login
run: |
oc login --token=${{ secrets.SILVER_TOOLS_BUILDER_TOKEN }} --server=${{ secrets.OPENSHIFT_CLUSTER_URL }}

- name: Promote core-api from test to prod
run: |
oc -n d8a8f9-tools tag \
d8a8f9-tools/pidp-frontend:${{ env.ORIG_TAG }} \
d8a8f9-tools/pidp-frontend:${{ env.PROMOTE_TAG }}
39 changes: 39 additions & 0 deletions .github/workflows/main-build-plr-intake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build PLR-Intake Backend

on:
push:
branches: [main]
paths:
- "backend/services.plr-intake/**"
- "backend/services.plr-intake.tests/**"
workflow_dispatch:


env:
ORIG_TAG: test
PROMOTE_TAG: main

# This will terminate builds that are previously, but continuing to run. Saves GHA hours.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
promote-image-to-prod:
name: WebAPI Backend Promote to prod
runs-on: ubuntu-latest
steps:
- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.7"

- name: oc login
run: |
oc login --token=${{ secrets.SILVER_TOOLS_BUILDER_TOKEN }} --server=${{ secrets.OPENSHIFT_CLUSTER_URL }}

- name: Promote core-api from test to prod
run: |
oc -n d8a8f9-tools tag \
d8a8f9-tools/pidp-plr-intake:${{ env.ORIG_TAG }} \
d8a8f9-tools/pidp-plr-intake:${{ env.PROMOTE_TAG }}
38 changes: 38 additions & 0 deletions .github/workflows/main-build-webapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build WebAPI

on:
push:
branches: [main]
paths:
- "backend/webapi/**"
- "backend/webapi.tests/**"
workflow_dispatch:

env:
ORIG_TAG: test
PROMOTE_TAG: main

# This will terminate builds that are previously, but continuing to run. Saves GHA hours.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
promote-image-to-prod:
name: WebAPI Backend Promote to prod
runs-on: ubuntu-latest
steps:
- name: Install oc
uses: redhat-actions/openshift-tools-installer@v1
with:
oc: "4.7"

- name: oc login
run: |
oc login --token=${{ secrets.SILVER_TOOLS_BUILDER_TOKEN }} --server=${{ secrets.OPENSHIFT_CLUSTER_URL }}

- name: Promote core-api from test to prod
run: |
oc -n d8a8f9-tools tag \
d8a8f9-tools/pidp-webapi:${{ env.ORIG_TAG }} \
d8a8f9-tools/pidp-webapi:${{ env.PROMOTE_TAG }}
35 changes: 35 additions & 0 deletions .github/workflows/main-deploy_helm_chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy Helm Charts - Prod

on:
push:
branches: [main]
paths:
- "charts/**"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider adding: ./deploy/prod_values.yaml

workflow_dispatch:

# This will terminate builds that are previously, but continuing to run. Saves GHA hours.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

helm-deployment:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v1

- name: Authenticate and set context
uses: redhat-actions/oc-login@v1.1
with:
openshift_server_url: ${{secrets.OPENSHIFT_CLUSTER_URL}}
openshift_token: ${{secrets.OPENSHIFT_TOKEN}}
namespace: d8a8f9-prod

- name: Helm Deploy / install command
run: |
echo current installed helm releases
helm list --namespace d8a8f9-prod

echo installing helm chart...
helm upgrade --wait --values ./deploy/prod_values.yaml --namespace d8a8f9-prod prod charts/pidp --debug
Loading