Skip to content

Commit 40c071d

Browse files
authored
26547 - Feature mailer remove minio (#3325)
1 parent 2fabc31 commit 40c071d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2384
-2493
lines changed

.github/workflows/account-mailer-ci.yml

Lines changed: 8 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -12,113 +12,17 @@ on:
1212
- "auth-api/src/auth_api/utils/enums.py"
1313
- "build-deps/**"
1414

15+
workflow_dispatch:
16+
1517
defaults:
1618
run:
1719
shell: bash
1820
working-directory: ./queue_services/account-mailer
1921

2022
jobs:
21-
setup-job:
22-
runs-on: ubuntu-24.04
23-
24-
if: github.repository == 'bcgov/sbc-auth'
25-
26-
steps:
27-
- uses: actions/checkout@v4
28-
- run: "true"
29-
30-
linting:
31-
needs: setup-job
32-
runs-on: ubuntu-24.04
33-
34-
strategy:
35-
matrix:
36-
python-version: [3.12]
37-
38-
steps:
39-
- uses: actions/checkout@v4
40-
- name: Set up Python ${{ matrix.python-version }}
41-
uses: actions/setup-python@v4
42-
with:
43-
python-version: ${{ matrix.python-version }}
44-
- name: Install dependencies
45-
run: |
46-
make setup
47-
- name: Lint with pylint
48-
id: pylint
49-
run: |
50-
make pylint
51-
- name: Lint with flake8
52-
id: flake8
53-
run: |
54-
make flake8
55-
56-
testing:
57-
needs: setup-job
58-
env:
59-
DATABASE_TEST_URL: "postgresql://postgres:postgres@localhost:5432/postgres"
60-
USE_TEST_KEYCLOAK_DOCKER: "YES"
61-
USE_DOCKER_MOCK: "YES"
62-
JWT_OIDC_ISSUER: "http://localhost:8081/auth/realms/demo"
63-
SBC_AUTH_ADMIN_CLIENT_ID: "sbc-auth-admin"
64-
SBC_AUTH_ADMIN_CLIENT_SECRET: "2222222222"
65-
MINIO_ENDPOINT: "localhost:9000"
66-
MINIO_ACCESS_KEY: "minio"
67-
MINIO_ACCESS_SECRET: "minio123"
68-
MINIO_BUCKET_NAME: "payment-sftp"
69-
MINIO_SECURE: False
70-
BCOL_ADMIN_EMAIL: "test@test.com"
71-
72-
runs-on: ubuntu-24.04
73-
strategy:
74-
matrix:
75-
python-version: [3.12]
76-
77-
services:
78-
postgres:
79-
image: postgres:12
80-
env:
81-
POSTGRES_USER: postgres
82-
POSTGRES_PASSWORD: postgres
83-
POSTGRES_DB: postgres
84-
ports:
85-
- 5432:5432
86-
# needed because the postgres container does not provide a healthcheck
87-
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
88-
89-
steps:
90-
- uses: actions/checkout@v4
91-
- name: Set up Python ${{ matrix.python-version }}
92-
uses: actions/setup-python@v1
93-
with:
94-
python-version: ${{ matrix.python-version }}
95-
- name: Install docker-compose
96-
run: |
97-
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
98-
sudo chmod +x /usr/local/bin/docker-compose
99-
docker-compose version
100-
- name: Install dependencies
101-
run: |
102-
make setup
103-
- name: Test with pytest
104-
id: test
105-
run: |
106-
make test
107-
- name: Upload coverage to Codecov
108-
uses: codecov/codecov-action@v3
109-
with:
110-
file: ./queue_services/account-mailer/coverage.xml
111-
flags: accountmailerqueue
112-
name: codecov-account-mailer
113-
fail_ci_if_error: false
114-
115-
build-check:
116-
needs: setup-job
117-
runs-on: ubuntu-24.04
118-
119-
steps:
120-
- uses: actions/checkout@v4
121-
- name: build to check strictness
122-
id: build
123-
run: |
124-
make build-nc
23+
account-mailer-ci:
24+
uses: bcgov/bcregistry-sre/.github/workflows/backend-ci.yaml@main
25+
with:
26+
app_name: "account-mailer"
27+
working_directory: "./queue_services/account-mailer"
28+
codecov_flag: "accountmailerqueue"

queue_services/account-mailer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.12.5-bullseye as development_build
1+
FROM python:3.12.9-bullseye as development_build
22
USER root
33

44
ARG VCS_REF="missing"

queue_services/account-mailer/Makefile

Lines changed: 0 additions & 139 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Account mailer package."""

queue_services/account-mailer/app.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919

2020
from account_mailer import create_app
2121

22-
2322
app = create_app()
2423

25-
if __name__ == '__main__':
26-
server_port = os.environ.get('PORT', '8080')
27-
app.run(debug=False, port=server_port, host='0.0.0.0')
24+
if __name__ == "__main__":
25+
server_port = os.environ.get("PORT", "8080")
26+
app.run(debug=False, port=server_port, host="0.0.0.0")

queue_services/account-mailer/devops/vaults.gcp.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ MINIO_ENDPOINT="op://minio/$APP_ENV/base/MINIO_ENDPOINT"
2020
MINIO_ACCESS_KEY="op://minio/$APP_ENV/base/MINIO_ACCESS_KEY"
2121
MINIO_ACCESS_SECRET="op://minio/$APP_ENV/base/MINIO_ACCESS_SECRET"
2222
MINIO_BUCKET="op://minio/$APP_ENV/account-mailer/MINIO_BUCKET"
23+
ACCOUNT_MAILER_BUCKET="op://buckets/$APP_ENV/auth/ACCOUNT_MAILER_BUCKET"
24+
STATIC_RESOURCES_BUCKET_URL="op://buckets/$APP_ENV/auth/STATIC_RESOURCES_BUCKET_URL"
2325
REFUND_REQUEST_RECIPIENTS="op://relationship/$APP_ENV/account-mailer/REFUND_REQUEST_RECIPIENTS"
2426
BCOL_REFUND_REQUEST_RECIPIENTS="op://relationship/$APP_ENV/account-mailer/BCOL_REFUND_REQUEST_RECIPIENTS"
2527
PDF_TEMPLATE_PATH="op://relationship/$APP_ENV/account-mailer/PDF_TEMPLATE_PATH"

queue_services/account-mailer/gunicorn_config.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
"""The configuration for gunicorn, which picks up the
15-
runtime options from environment variables
16-
"""
1714

18-
import os
15+
"""The configuration for gunicorn."""
1916

17+
import os
2018

21-
workers = int(os.environ.get('GUNICORN_PROCESSES', '1')) # pylint: disable=invalid-name
22-
timeout = int(os.environ.get('GUNICORN_TIMEOUT', '0')) # pylint: disable=invalid-name
23-
threads = int(os.environ.get('GUNICORN_THREADS', '1')) # pylint: disable=invalid-name
19+
workers = int(os.environ.get("GUNICORN_PROCESSES", "1")) # pylint: disable=invalid-name
20+
timeout = int(os.environ.get("GUNICORN_TIMEOUT", "0")) # pylint: disable=invalid-name
21+
threads = int(os.environ.get("GUNICORN_THREADS", "1")) # pylint: disable=invalid-name
2422

25-
forwarded_allow_ips = '*' # pylint: disable=invalid-name
26-
secure_scheme_headers = {'X-Forwarded-Proto': 'https'} # pylint: disable=invalid-name
23+
forwarded_allow_ips = "*" # pylint: disable=invalid-name
24+
secure_scheme_headers = {"X-Forwarded-Proto": "https"} # pylint: disable=invalid-name

0 commit comments

Comments
 (0)