Skip to content

Commit

Permalink
fix(deployment): added env variables to deployment (#918)
Browse files Browse the repository at this point in the history
## Introduction ✏️
Ensure new environment variables are assigned during deployment.

## Resolution ✔️
* Added to `deployment.yml`.

## Miscellaneous ➕
* Consistent naming convention
* Updated `.env.sample`
* Removed `postinstall` script due to `husky` being part of development
dependency.

Co-authored-by: Abhi Markan <[email protected]>
  • Loading branch information
abhi-markan and abhi-markan authored Jun 4, 2024
1 parent e8a8300 commit eaf7fad
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ APIM_INFORMATICA_TIMEOUT= # in milliseconds
# ORDNANCE SURVEY
ORDNANCE_SURVEY_URL=https://api.os.uk
ORDNANCE_SURVEY_KEY=
ORDNANCE_SURVEY_MAX_REDIRECTS=
ORDNANCE_SURVEY_TIMEOUT= # in milliseconds
ORDNANCE_SURVEY_MAX_REDIRECTS=5
ORDNANCE_SURVEY_TIMEOUT=30000 # in milliseconds

# COMPANIES HOUSE
COMPANIES_HOUSE_URL=
COMPANIES_HOUSE_URL=https://api.companieshouse.gov.uk
COMPANIES_HOUSE_KEY=
COMPANIES_HOUSE_MAX_REDIRECTS=
COMPANIES_HOUSE_TIMEOUT= # in milliseconds
COMPANIES_HOUSE_MAX_REDIRECTS=5
COMPANIES_HOUSE_TIMEOUT=30000 # in milliseconds
12 changes: 10 additions & 2 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ on:
env:
PRODUCT: apim
ENVIRONMENT: ${{ github.ref_name }}
timezone: ${{ vars.TIMEZONE }}
TIMEZONE: ${{ vars.TIMEZONE }}
# Base artifact
FROM: latest

Expand Down Expand Up @@ -140,7 +140,15 @@ jobs:
"APIM_INFORMATICA_PASSWORD=${{ secrets.APIM_INFORMATICA_PASSWORD }}" \
"APIM_INFORMATICA_MAX_REDIRECTS=${{ secrets.APIM_INFORMATICA_MAX_REDIRECTS }}" \
"APIM_INFORMATICA_TIMEOUT=${{ secrets.APIM_INFORMATICA_TIMEOUT }}" \
"API_KEY=${{ secrets.API_KEY }}"
"API_KEY=${{ secrets.API_KEY }}" \
"ORDNANCE_SURVEY_URL=${{ secrets.ORDNANCE_SURVEY_URL }}" \
"ORDNANCE_SURVEY_KEY=${{ secrets.ORDNANCE_SURVEY_KEY }}" \
"ORDNANCE_SURVEY_MAX_REDIRECTS=${{ secrets.ORDNANCE_SURVEY_MAX_REDIRECTS }}" \
"ORDNANCE_SURVEY_TIMEOUT=${{ secrets.ORDNANCE_SURVEY_TIMEOUT }}" \
"COMPANIES_HOUSE_URL=${{ secrets.COMPANIES_HOUSE_URL }}" \
"COMPANIES_HOUSE_KEY=${{ secrets.COMPANIES_HOUSE_KEY }}" \
"COMPANIES_HOUSE_MAX_REDIRECTS=${{ secrets.COMPANIES_HOUSE_MAX_REDIRECTS }}" \
"COMPANIES_HOUSE_TIMEOUT=${{ secrets.COMPANIES_HOUSE_TIMEOUT }}"
- name: Import ⬇️
if: ${{ '' != env.API_ID }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

env:
environment: "qa"
timezone: ${{ vars.TIMEZONE }}
TIMEZONE: ${{ vars.TIMEZONE }}

jobs:
# 1. Setup test infrastructure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/infrastructure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ on:
env:
PRODUCT: apim
ENVIRONMENT: infrastructure
timezone: ${{ vars.TIMEZONE }}
TIMEZONE: ${{ vars.TIMEZONE }}
# Deployment environment target i.e., `dev`, `staging`, `production`
TARGET: ${{ vars.ENVIRONMENT }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ on:

env:
environment: "qa"
timezone: ${{ vars.TIMEZONE }}
TIMEZONE: ${{ vars.TIMEZONE }}

jobs:
# 1. Setup test infrastructure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- cron: "00 00 * * *"
env:
environment: "qa"
timezone: ${{ vars.TIMEZONE }}
TIMEZONE: ${{ vars.TIMEZONE }}

jobs:
# 1. Setup test infrastructure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

env:
environment: "qa"
timezone: ${{ vars.TIMEZONE }}
TIMEZONE: ${{ vars.TIMEZONE }}

jobs:
# 1. Setup test infrastructure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

env:
environment: "qa"
timezone: ${{ vars.TIMEZONE }}
TIMEZONE: ${{ vars.TIMEZONE }}

jobs:
# 1. Setup test infrastructure
Expand Down
7 changes: 3 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"api-test": "jest --selectProjects=API",
"build": "nest build -p tsconfig.build.json",
"housekeeping": "npm update --save --legacy-peer-deps && npm i --legacy-peer-deps && npm audit --fix && npm run spellcheck",
"postinstall": "husky install",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"prettier": "prettier --no-error-on-unmatched-pattern --check **/*.{ts,js}",
Expand Down

0 comments on commit eaf7fad

Please sign in to comment.