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

CD: build nr duplicates report in GCP #1602

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
109 changes: 18 additions & 91 deletions .github/workflows/nr-duplicates-report-cd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Namex Duplicates Report Job CD
name: NR Duplicates Report CD

on:
push:
Expand All @@ -8,96 +8,23 @@ on:
- "jobs/nr-duplicates-report/**"
workflow_dispatch:
inputs:
environment:
description: "Environment (dev/test/prod)"
target:
description: "Deploy To"
required: true
default: "dev"

defaults:
run:
shell: bash
working-directory: ./jobs/nr-duplicates-report

env:
APP_NAME: "nr-duplicates-report"
TAG_NAME: "dev"
type: choice
options:
- dev
- test
- sandbox
- prod

jobs:
nr-duplicates-report-cd-by-push:
runs-on: ubuntu-20.04

if: github.event_name == 'push' && github.repository == 'bcgov/namex'
environment:
name: "dev"

steps:
- uses: actions/checkout@v2

- name: Login Openshift
shell: bash
run: |
oc login --server=${{secrets.OPENSHIFT4_LOGIN_REGISTRY}} --token=${{secrets.OPENSHIFT4_SA_TOKEN}}

- name: CD Flow
shell: bash
env:
OPS_REPOSITORY: ${{ secrets.OPS_REPOSITORY }}
OPENSHIFT_DOCKER_REGISTRY: ${{ secrets.OPENSHIFT4_DOCKER_REGISTRY }}
OPENSHIFT_SA_NAME: ${{ secrets.OPENSHIFT4_SA_NAME }}
OPENSHIFT_SA_TOKEN: ${{ secrets.OPENSHIFT4_SA_TOKEN }}
OPENSHIFT_REPOSITORY: ${{ secrets.OPENSHIFT4_REPOSITORY }}
TAG_NAME: ${{ env.TAG_NAME }}
run: |
make cd

- name: Rocket.Chat Notification
uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@master
if: failure()
with:
type: ${{ job.status }}
job_name: "*NR Duplicates Report Job Built and Deployed to ${{env.TAG_NAME}}*"
channel: "#registries-bot"
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}

nr-duplicates-report-cd-by-dispatch:
runs-on: ubuntu-20.04

if: github.event_name == 'workflow_dispatch' && github.repository == 'bcgov/namex'
environment:
name: "${{ github.event.inputs.environment }}"

steps:
- uses: actions/checkout@v2
- name: Set env by input
run: |
echo "TAG_NAME=${{ github.event.inputs.environment }}" >> $GITHUB_ENV

- name: Login Openshift
shell: bash
run: |
oc login --server=${{secrets.OPENSHIFT4_LOGIN_REGISTRY}} --token=${{secrets.OPENSHIFT4_SA_TOKEN}}

- name: CD Flow
shell: bash
env:
OPS_REPOSITORY: ${{ secrets.OPS_REPOSITORY }}
OPENSHIFT_DOCKER_REGISTRY: ${{ secrets.OPENSHIFT4_DOCKER_REGISTRY }}
OPENSHIFT_SA_NAME: ${{ secrets.OPENSHIFT4_SA_NAME }}
OPENSHIFT_SA_TOKEN: ${{ secrets.OPENSHIFT4_SA_TOKEN }}
OPENSHIFT_REPOSITORY: ${{ secrets.OPENSHIFT4_REPOSITORY }}
TAG_NAME: ${{ env.TAG_NAME }}
run: |
make cd

- name: Rocket.Chat Notification
uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@master
if: failure()
with:
type: ${{ job.status }}
job_name: "*NR Duplicates Report Job Built and Deployed to ${{env.TAG_NAME}}*"
channel: "#registries-bot"
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
nr-duplicates-report-cd:
uses: bcgov/bcregistry-sre/.github/workflows/backend-job-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "nr-duplicates-report"
working_directory: "./jobs/nr-duplicates-report"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
88 changes: 10 additions & 78 deletions .github/workflows/nr-duplicates-report-ci.yml
Original file line number Diff line number Diff line change
@@ -1,90 +1,22 @@
name: NR Duplicates Report Job CI
name: NR Duplicates Report CI

on:
pull_request:
types: [assigned, synchronize]
paths:
- "jobs/nr-duplicates-report/**"
workflow_dispatch:

defaults:
run:
shell: bash
working-directory: ./jobs/nr-duplicates-report

jobs:
setup-job:
runs-on: ubuntu-20.04

if: github.repository == 'bcgov/namex'

steps:
- uses: actions/checkout@v2
- run: "true"

linting:
needs: setup-job
runs-on: ubuntu-20.04

strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make setup
- name: Lint with pylint
id: pylint
run: |
make pylint
- name: Lint with flake8
id: flake8
run: |
make flake8

testing:
needs: setup-job
env:
PG_USER: postgres
PG_PASSWORD: postgres
PG_DB_NAME: postgres
PG_HOST: localhost
PG_PORT: 5432

runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make setup
- name: Test with pytest
id: test
run: |
# make test
#- name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1
# with:
# file: ./queue_services/entity-pay/coverage.xml
# flags: entitypay
# name: codecov-entity-pay
# fail_ci_if_error: true

build-check:
needs: setup-job
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: build to check strictness
id: build
run: |
make build-nc
nr-duplicates-report-ci:
uses: bcgov/bcregistry-sre/.github/workflows/backend-ci.yaml@main
with:
app_name: "nr-duplicates-report"
working_directory: "./jobs/nr-duplicates-report"
codecov_flag: "nr-duplicates-report"
skip_isort: "true"
skip_black: "true"
103 changes: 0 additions & 103 deletions .github/workflows/nro-extractor-cd.yml

This file was deleted.

Loading
Loading