-
Notifications
You must be signed in to change notification settings - Fork 40
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
1 parent
6040e1f
commit 4e05ec3
Showing
3 changed files
with
101 additions
and
82 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: TFRS New Pipeline Dev | ||
name: TFRS New Pipeline Dev release-2.22.0 | ||
|
||
on: | ||
push: | ||
|
@@ -20,9 +20,37 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
install-oc: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
cache-hit: ${{ steps.cache.outputs.cache-hit }} | ||
steps: | ||
- name: Check out repository | ||
uses: actions/[email protected] | ||
|
||
- name: Set up cache for OpenShift CLI | ||
id: cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /usr/local/bin/oc # Path where the `oc` binary will be installed | ||
key: oc-cli-${{ runner.os }} | ||
|
||
- name: Install OpenShift CLI (if not cached) | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz | ||
tar -xvf openshift-client-linux.tar.gz | ||
sudo mv oc /usr/local/bin/ | ||
oc version --client | ||
- name: Confirm OpenShift CLI is Available | ||
run: oc version --client | ||
|
||
get-version: | ||
name: Get the version | ||
runs-on: ubuntu-latest | ||
needs: [install-oc] | ||
|
||
outputs: | ||
VERSION: ${{ steps.get-version.outputs.VERSION }} | ||
|
@@ -47,12 +75,11 @@ jobs: | |
with: | ||
ref: ${{ env.GIT_REF }} | ||
|
||
- name: Install OpenShift CLI | ||
run: | | ||
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz | ||
tar -xvf openshift-client-linux.tar.gz | ||
sudo mv oc kubectl /usr/local/bin/ | ||
oc version --client | ||
- name: Restore oc command from Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /usr/local/bin/oc | ||
key: oc-cli-${{ runner.os }} | ||
|
||
- name: Log in to Openshift | ||
uses: redhat-actions/[email protected] | ||
|
@@ -89,12 +116,11 @@ jobs: | |
with: | ||
ref: ${{ env.GIT_REF }} | ||
|
||
- name: Install OpenShift CLI | ||
run: | | ||
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz | ||
tar -xvf openshift-client-linux.tar.gz | ||
sudo mv oc kubectl /usr/local/bin/ | ||
oc version --client | ||
- name: Restore oc command from Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /usr/local/bin/oc | ||
key: oc-cli-${{ runner.os }} | ||
|
||
- name: Log in to Openshift | ||
uses: redhat-actions/[email protected] | ||
|
@@ -131,12 +157,11 @@ jobs: | |
with: | ||
ref: ${{ env.GIT_REF }} | ||
|
||
- name: Install OpenShift CLI | ||
run: | | ||
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz | ||
tar -xvf openshift-client-linux.tar.gz | ||
sudo mv oc kubectl /usr/local/bin/ | ||
oc version --client | ||
- name: Restore oc command from Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /usr/local/bin/oc | ||
key: oc-cli-${{ runner.os }} | ||
|
||
- name: Log in to Openshift | ||
uses: redhat-actions/[email protected] | ||
|
@@ -162,7 +187,7 @@ jobs: | |
name: Build TFRS Celery | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
needs: [get-version, build-backend, build-frontend, build-scan-coordinator] | ||
needs: [build-backend, build-frontend, build-scan-coordinator] | ||
|
||
env: | ||
BUILD_SUFFIX: ${{ needs.get-version.outputs.VERSION }} | ||
|
@@ -173,12 +198,11 @@ jobs: | |
with: | ||
ref: ${{ env.GIT_REF }} | ||
|
||
- name: Install OpenShift CLI | ||
run: | | ||
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz | ||
tar -xvf openshift-client-linux.tar.gz | ||
sudo mv oc kubectl /usr/local/bin/ | ||
oc version --client | ||
- name: Restore oc command from Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /usr/local/bin/oc | ||
key: oc-cli-${{ runner.os }} | ||
|
||
- name: Log in to Openshift | ||
uses: redhat-actions/[email protected] | ||
|
@@ -204,7 +228,7 @@ jobs: | |
name: Build TFRS scan-handler | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
needs: [get-version, build-backend, build-frontend, build-scan-coordinator] | ||
needs: [build-backend, build-frontend, build-scan-coordinator] | ||
|
||
env: | ||
BUILD_SUFFIX: ${{ needs.get-version.outputs.VERSION }} | ||
|
@@ -215,12 +239,11 @@ jobs: | |
with: | ||
ref: ${{ env.GIT_REF }} | ||
|
||
- name: Install OpenShift CLI | ||
run: | | ||
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz | ||
tar -xvf openshift-client-linux.tar.gz | ||
sudo mv oc kubectl /usr/local/bin/ | ||
oc version --client | ||
- name: Restore oc command from Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /usr/local/bin/oc | ||
key: oc-cli-${{ runner.os }} | ||
|
||
- name: Log in to Openshift | ||
uses: redhat-actions/[email protected] | ||
|
@@ -246,7 +269,7 @@ jobs: | |
name: Build TFRS Notification Server | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
needs: [get-version, build-backend, build-frontend, build-scan-coordinator] | ||
needs: [build-backend, build-frontend, build-scan-coordinator] | ||
|
||
env: | ||
BUILD_SUFFIX: ${{ needs.get-version.outputs.VERSION }} | ||
|
@@ -257,12 +280,11 @@ jobs: | |
with: | ||
ref: ${{ env.GIT_REF }} | ||
|
||
- name: Install OpenShift CLI | ||
run: | | ||
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz | ||
tar -xvf openshift-client-linux.tar.gz | ||
sudo mv oc kubectl /usr/local/bin/ | ||
oc version --client | ||
- name: Restore oc command from Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /usr/local/bin/oc | ||
key: oc-cli-${{ runner.os }} | ||
|
||
- name: Log in to Openshift | ||
uses: redhat-actions/[email protected] | ||
|
@@ -288,10 +310,8 @@ jobs: | |
name: Deploy on Dev | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
# needs: [get-version] | ||
needs: | ||
[ | ||
get-version, | ||
build-backend, | ||
build-frontend, | ||
build-celery, | ||
|
@@ -311,13 +331,6 @@ jobs: | |
repository: bcgov-c/tenant-gitops-0ab226 | ||
ref: main | ||
ssh-key: ${{ secrets.MANIFEST_REPO_DEPLOY_KEY }} | ||
|
||
- name: Install OpenShift CLI | ||
run: | | ||
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/ocp/stable/openshift-client-linux.tar.gz | ||
tar -xvf openshift-client-linux.tar.gz | ||
sudo mv oc kubectl /usr/local/bin/ | ||
oc version --client | ||
|
||
- name: Update tags | ||
uses: mikefarah/[email protected] | ||
|
@@ -339,6 +352,12 @@ jobs: | |
git commit -m "Update the image tag to ${{ env.BUILD_SUFFIX }} on Dev" | ||
git push | ||
- name: Restore oc command from Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /usr/local/bin/oc | ||
key: oc-cli-${{ runner.os }} | ||
|
||
- name: Log in to Openshift | ||
uses: redhat-actions/[email protected] | ||
with: | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: TFRS New Pipeline Prod | ||
name: TFRS New Pipeline Prod release-2.22.0 | ||
|
||
on: | ||
workflow_dispatch: | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: TFRS New Pipeline Test | ||
name: TFRS New Pipeline Test release-2.22.0 | ||
|
||
on: | ||
workflow_dispatch: | ||
|
@@ -95,27 +95,27 @@ jobs: | |
ref: main | ||
ssh-key: ${{ secrets.MANIFEST_REPO_DEPLOY_KEY }} | ||
|
||
# - name: Update tags | ||
# uses: mikefarah/[email protected] | ||
# with: | ||
# cmd: | | ||
# yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/backend/values-test.yaml | ||
# yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/frontend/values-test.yaml | ||
# yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/notification-server/values-test.yaml | ||
# yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/celery/values-test.yaml | ||
# yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/scan-coordinator/values-test.yaml | ||
# yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/scan-handler/values-test.yaml | ||
|
||
# - name: GitHub Commit & Push | ||
# shell: bash {0} | ||
# run: | | ||
# git config --global user.email "[email protected]" | ||
# git config --global user.name "GitHub Actions" | ||
# git add -A | ||
# git commit -m "Update the image tag to ${{ env.BUILD_SUFFIX }} on Test" | ||
# git push | ||
|
||
- name: Restore oc command from Cßache | ||
- name: Update tags | ||
uses: mikefarah/[email protected] | ||
with: | ||
cmd: | | ||
yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/backend/values-test.yaml | ||
yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/frontend/values-test.yaml | ||
yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/notification-server/values-test.yaml | ||
yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/celery/values-test.yaml | ||
yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/scan-coordinator/values-test.yaml | ||
yq -i '.image.tag = "${{ env.BUILD_SUFFIX }}"' tfrs/charts/scan-handler/values-test.yaml | ||
# - name: GitHub Commit & Push | ||
# shell: bash {0} | ||
# run: | | ||
# git config --global user.email "[email protected]" | ||
# git config --global user.name "GitHub Actions" | ||
# git add -A | ||
# git commit -m "Update the image tag to ${{ env.BUILD_SUFFIX }} on Test" | ||
# git push | ||
|
||
- name: Restore oc command from Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: /usr/local/bin/oc | ||
|
@@ -129,23 +129,23 @@ jobs: | |
insecure_skip_tls_verify: true | ||
namespace: ${{ env.TOOLS_NAMESPACE }} | ||
|
||
- name: Tag and deploy to Test | ||
run: | | ||
helm -n ${{ env.TEST_NAMESPACE }} list | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-backend:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-backend:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-frontend:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-frontend:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-celery:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-celery:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-scan-coordinator:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-scan-coordinator:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-scan-handler:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-scan-handler:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-notification-server:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-notification-server:${{ env.BUILD_SUFFIX }} | ||
# - name: Tag and deploy to Test | ||
# run: | | ||
# helm -n ${{ env.TEST_NAMESPACE }} list | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-backend:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-backend:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-frontend:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-frontend:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-celery:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-celery:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-scan-coordinator:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-scan-coordinator:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-scan-handler:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-scan-handler:${{ env.BUILD_SUFFIX }} | ||
# oc tag ${{ env.DEV_NAMESPACE }}/tfrs-notification-server:${{ env.BUILD_SUFFIX }} ${{ env.TEST_NAMESPACE }}/tfrs-notification-server:${{ env.BUILD_SUFFIX }} | ||
|
||
- name: Ask for approval for TFRS Test deployment | ||
uses: trstringer/[email protected] | ||
with: | ||
secret: ${{ github.TOKEN }} | ||
approvers: AlexZorkin,kuanfandevops,prv-proton,JulianForeman,kevin-hashimoto,dhaselhan | ||
minimum-approvals: 1 | ||
issue-title: "TFRS ${{ env.GIT_REF }} Test Deployment at $(date '+%Y-%m-%d %H:%M:%S %Z')" | ||
issue-title: eval ("TFRS ${{ env.GIT_REF }} Test Deployment at " + $(date '+%Y-%m-%d %H:%M:%S %Z') ) | ||
|
||
# - name: Helm Deployment | ||
# run: | | ||
|