Skip to content

Commit

Permalink
Revert "21464 - Resync EFT branch with main (#1547)" (#1550)
Browse files Browse the repository at this point in the history
This reverts commit 23fed0f.
  • Loading branch information
seeker25 authored May 31, 2024
1 parent 23fed0f commit d235277
Show file tree
Hide file tree
Showing 282 changed files with 1,950 additions and 1,908 deletions.
118 changes: 18 additions & 100 deletions .github/workflows/pay-queue-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,112 +4,30 @@ on:
push:
branches:
- main
- feature*
paths:
- "pay-queue/**"
- "pay-api/src/pay_api/models/**"
- "pay-api/src/pay_api/services/cfs_service.py"
workflow_dispatch:
inputs:
environment:
description: "Environment (dev/test/prod)"
target:
description: "Deploy To"
required: true
default: "dev"

defaults:
run:
shell: bash
working-directory: ./pay-queue

env:
APP_NAME: "pay-queue"
TAG_NAME: "dev"
type: choice
options:
- dev
- test
- sandbox
- prod

jobs:
pay-queue-cd-by-push:
runs-on: ubuntu-20.04

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

steps:
- uses: actions/checkout@v3

- 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: Watch new rollout (trigger by image change in Openshift)
shell: bash
run: |
oc rollout status dc/${{ env.APP_NAME }}-${{ env.TAG_NAME }} -n ${{ secrets.OPENSHIFT4_REPOSITORY }}-${{ env.TAG_NAME }} -w
- name: Rocket.Chat Notification
uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@master
if: failure()
with:
type: ${{ job.status }}
job_name: "*Payment Reconciliations Queue Built and Deployed to ${{env.TAG_NAME}}*"
channel: "#registries-bot"
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}

pay-queue-cd-by-dispatch:
runs-on: ubuntu-20.04

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

steps:
- uses: actions/checkout@v3
- 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: Watch new rollout (trigger by image change in Openshift)
shell: bash
run: |
oc rollout status dc/${{ env.APP_NAME }}-${{ env.TAG_NAME }} -n ${{ secrets.OPENSHIFT4_REPOSITORY }}-${{ env.TAG_NAME }} -w
- name: Rocket.Chat Notification
uses: RocketChat/Rocket.Chat.GitHub.Action.Notification@master
if: failure()
with:
type: ${{ job.status }}
job_name: "*Payment Reconciliations Queue Built and Deployed to ${{env.TAG_NAME}}*"
channel: "#registries-bot"
url: ${{ secrets.ROCKETCHAT_WEBHOOK }}
commit: true
token: ${{ secrets.GITHUB_TOKEN }}
pay-queue-cd:
uses: bcgov/bcregistry-sre/.github/workflows/cloud-run-service-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "pay-queue"
working_directory: "./pay-queue"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
GCP_SERVICE_ACCOUNT: ${{ secrets.GCP_SERVICE_ACCOUNT }}
1 change: 1 addition & 0 deletions .github/workflows/pay-queue-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ defaults:
run:
shell: bash
working-directory: ./pay-queue

jobs:
setup-job:
runs-on: ubuntu-20.04
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/pay-queue-gcp-cd.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,3 @@ ACK.INBOX.F12022020202
pay-queue/ACK.*
pay-queue/FEEDBACK.*
jobs/notebook-report/data/
test_eft_tdi17.txt
ACK.INBOX*
FEEDBACK.INBOX*
2 changes: 1 addition & 1 deletion bcol-api/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ python-ldap==3.4.4
pytz==2024.1
requests-file==2.0.0
requests-toolbelt==1.0.0
requests==2.32.2
requests==2.31.0
rsa==4.9
sentry-sdk==1.41.0
six==1.16.0
Expand Down
2 changes: 1 addition & 1 deletion jobs/ftp-poller/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ tag: push ## tag image
#################################################################################

run: ## Run the project in local
echo "unimplememted use docker"
. venv/bin/activate && python app.py

#################################################################################
# Self Documenting Commands #
Expand Down
8 changes: 5 additions & 3 deletions jobs/ftp-poller/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ class _Config(object): # pylint: disable=too-few-public-methods
SENTRY_ENABLE = os.getenv('SENTRY_ENABLE', 'False')
SENTRY_DSN = os.getenv('SENTRY_DSN', None)

# PUB/SUB - PUB: ftp-poller-payment-reconciliation-dev
FTP_POLLER_TOPIC = os.getenv('FTP_POLLER_TOPIC', 'ftp-poller-payment-reconciliation-dev')
GCP_AUTH_KEY = os.getenv('AUTHPAY_GCP_AUTH_KEY', None)
# GCP PubSub
AUDIENCE = os.getenv('AUDIENCE', None)
GCP_AUTH_KEY = os.getenv('GCP_AUTH_KEY', None)
PUBLISHER_AUDIENCE = os.getenv('PUBLISHER_AUDIENCE', None)
FTP_POLLER_TOPIC = os.getenv('FTP_POLLER_TOPIC', None)

TESTING = False
DEBUG = True
Expand Down
7 changes: 0 additions & 7 deletions jobs/ftp-poller/devops/vaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,5 @@
"application": [
"relationship-api"
]
},
{
"vault": "gcp-queue",
"application": [
"gtksf3",
"topics"
]
}
]
4 changes: 1 addition & 3 deletions jobs/ftp-poller/invoke_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import sentry_sdk
from flask import Flask
from sentry_sdk.integrations.flask import FlaskIntegration
from pay_api.services.gcp_queue import queue

import config
from utils.logger import setup_logging
Expand All @@ -44,8 +43,7 @@ def create_app(run_mode=os.getenv('FLASK_ENV', 'production')):
dsn=app.config.get('SENTRY_DSN'),
integrations=[FlaskIntegration()]
)
app.logger.info('<<<< Starting Ftp Poller Job >>>>')
queue.init_app(app)
app.logger.info(f'<<<< Starting Ftp Poller Job >>>>')
ma.init_app(app)

register_shellcontext(app)
Expand Down
139 changes: 139 additions & 0 deletions jobs/ftp-poller/openshift/ftp-poller-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"annotations": {
"description": "Build template for a FTP Poller job.",
"tags": "flask",
"iconClass": "icon-python"
},
"name": "${NAME}-build-template"
},
"objects": [
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "${NAME}"
}
},
{
"kind": "BuildConfig",
"apiVersion": "v1",
"metadata": {
"name": "${NAME}",
"labels": {
"app": "${NAME}",
"app-group": "${APP_GROUP}",
"template": "${NAME}-build"
}
},
"spec": {
"source": {
"type": "Git",
"git": {
"uri": "${GIT_REPO_URL}",
"ref": "${GIT_REF}"
},
"contextDir": "${SOURCE_CONTEXT_DIR}"
},
"strategy": {
"type": "Docker",
"dockerStrategy": {
"dockerfilePath": "${DOCKER_FILE_PATH}"
}
},
"output": {
"to": {
"kind": "ImageStreamTag",
"name": "${NAME}:${OUTPUT_IMAGE_TAG}"
}
},
"triggers": [
{
"type": "ConfigChange"
}
]
}
}
],
"parameters": [
{
"name": "NAME",
"displayName": "Name",
"description": "The name assigned to all of the objects defined in this template. You should keep this as default unless your know what your doing.",
"required": true,
"value": "ftp-poller"
},
{
"name": "APP_GROUP",
"displayName": "App Group",
"description": "The name assigned to all of the deployments in this project.",
"required": true,
"value": "sbc-pay"
},
{
"name": "GIT_REPO_URL",
"displayName": "Git Repo URL",
"description": "The URL to your GIT repo, don't use the this default unless your just experimenting.",
"required": true,
"value": "https://github.com/bcgov/sbc-pay.git"
},
{
"name": "GIT_REF",
"displayName": "Git Reference",
"description": "The git reference or branch.",
"required": true,
"value": "development"
},
{
"name": "SOURCE_CONTEXT_DIR",
"displayName": "Source Context Directory",
"description": "The source context directory.",
"required": true,
"value": "jobs/ftp-poller"
},
{
"name": "SOURCE_IMAGE_KIND",
"displayName": "Source Image Kind",
"required": true,
"description": "The 'kind' (type) of the source image; typically ImageStreamTag, or DockerImage.",
"value": "ImageStreamTag"
},
{
"name": "SOURCE_IMAGE_NAME_SPACE",
"displayName": "Source Image Name Space",
"required": true,
"description": "The name space of the source image.",
"value": "d7eovc-tools"
},
{
"name": "SOURCE_IMAGE_NAME",
"displayName": "Source Image Name",
"required": true,
"description": "The name of the source image.",
"value": "python"
},
{
"name": "SOURCE_IMAGE_TAG",
"displayName": "Source Image Tag",
"required": true,
"description": "The tag of the source image.",
"value": "3.7"
},
{
"name": "OUTPUT_IMAGE_TAG",
"displayName": "Output Image Tag",
"description": "The tag given to the built image.",
"required": true,
"value": "latest"
},
{
"name": "DOCKER_FILE_PATH",
"displayName": "Docker File Path",
"description": "The path to the docker file defining the build.",
"required": false,
"value": "Dockerfile"
}
]
}
Loading

0 comments on commit d235277

Please sign in to comment.