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

UAT and STG environment setup #420

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
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
23 changes: 19 additions & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ type: kubernetes
environment:
APP_NAME: firearms-licensing
PROD_ENV: firearms
STG_ENV: firearms-preprod
UAT_ENV: firearms-dev
STG_ENV: firearms-stg
UAT_ENV: firearms-uat
BRANCH_ENV: firearms-branch
PRODUCTION_URL: www.firearms-licensing.homeoffice.gov.uk
IMAGE_URL: quay.io/ukhomeofficedigital
Expand Down Expand Up @@ -227,6 +227,21 @@ steps:
branch: master
event: pull_request

- name: TEST_deploy_to_stg
pull: if-not-exists
image: quay.io/ukhomeofficedigital/kd:v1.14.0
environment:
# NOTIFY_STUB: stub
KUBE_SERVER:
from_secret: kube_server_stg
KUBE_TOKEN:
from_secret: kube_token_stg
commands:
- bin/deploy.sh $${STG_ENV}
when:
branch: master
event: pull_request

# Snyk & Anchore security scans which run after branch deployment to prevent blocking of PR UAT tests
- name: snyk_scan
pull: if-not-exists
Expand Down Expand Up @@ -322,9 +337,9 @@ steps:
# image: quay.io/ukhomeofficedigital/kd:v1.14.0
# environment:
# KUBE_SERVER:
# from_secret: kube_server_dev
# from_secret: kube_server_stg
# KUBE_TOKEN:
# from_secret: kube_token_dev
# from_secret: kube_token_stg
# commands:
# - bin/deploy.sh $${STG_ENV}
# when:
Expand Down
4 changes: 2 additions & 2 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ if [[ ${KUBE_NAMESPACE} == ${BRANCH_ENV} ]]; then
$kd -f kube/redis -f kube/html-pdf -f kube/file-vault -f kube/app
elif [[ ${KUBE_NAMESPACE} == ${UAT_ENV} ]]; then
$kd -f kube/configmaps/configmap.yml -f kube/app/service.yml
$kd -f kube/app/ingress-external.yml -f kube/app/networkpolicy-external.yml
$kd -f kube/app/ingress-internal.yml -f kube/app/networkpolicy-internal.yml
$kd -f kube/redis -f kube/html-pdf -f kube/file-vault -f kube/app/deployment.yml
elif [[ ${KUBE_NAMESPACE} == ${STG_ENV} ]]; then
$kd -f kube/configmaps/configmap.yml -f kube/app/service.yml
$kd -f kube/app/ingress-external.yml -f kube/app/networkpolicy-external.yml
$kd -f kube/app/ingress-internal.yml -f kube/app/networkpolicy-internal.yml
$kd -f kube/redis -f kube/html-pdf -f kube/file-vault -f kube/app/deployment.yml
elif [[ ${KUBE_NAMESPACE} == ${PROD_ENV} ]]; then
$kd -f kube/configmaps/configmap.yml -f kube/app/service.yml
Expand Down
2 changes: 1 addition & 1 deletion kube/app/ingress-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
- {{ .DRONE_BUILD_NUMBER }}.internal.{{ .BRANCH_ENV }}.homeoffice.gov.uk
- {{ .APP_NAME }}-{{ .DRONE_SOURCE_BRANCH }}.internal.{{ .BRANCH_ENV }}.homeoffice.gov.uk
{{ else if eq .KUBE_NAMESPACE .UAT_ENV }}
- firearms.uat.internal.sas-notprod.homeoffice.gov.uk
- firearms-licensing.uat.internal.sas-notprod.homeoffice.gov.uk
- {{ .APP_NAME }}.uat.internal.sas-notprod.homeoffice.gov.uk
{{ else if eq .KUBE_NAMESPACE .STG_ENV }}
- stg.internal.firearms.sas.homeoffice.gov.uk
Expand Down
8 changes: 4 additions & 4 deletions kube/file-vault/file-vault-ingress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ spec:
{{ if eq .KUBE_NAMESPACE .BRANCH_ENV }}
- fv-branch.{{ .BRANCH_ENV }}.homeoffice.gov.uk
{{ else if eq .KUBE_NAMESPACE .UAT_ENV }}
- supp-docs-dev.notprod.{{ .APP_NAME }}.homeoffice.gov.uk
- supp-docs-uat.notprod.{{ .APP_NAME }}.homeoffice.gov.uk
{{ else if eq .KUBE_NAMESPACE .STG_ENV }}
- supp-docs-preprod.notprod.{{ .APP_NAME }}.homeoffice.gov.uk
- supp-docs-stg.prod.{{ .APP_NAME }}.homeoffice.gov.uk
{{ else if eq .KUBE_NAMESPACE .PROD_ENV }}
- supp-docs.prod.{{ .APP_NAME }}.homeoffice.gov.uk
{{ end }}
Expand All @@ -24,9 +24,9 @@ spec:
{{ if eq .KUBE_NAMESPACE .BRANCH_ENV }}
- host: fv-branch.{{ .BRANCH_ENV }}.homeoffice.gov.uk
{{ else if eq .KUBE_NAMESPACE .UAT_ENV }}
- host: supp-docs-dev.notprod.{{ .APP_NAME }}.homeoffice.gov.uk
- host: supp-docs-uat.notprod.{{ .APP_NAME }}.homeoffice.gov.uk
{{ else if eq .KUBE_NAMESPACE .STG_ENV }}
- host: supp-docs-preprod.notprod.{{ .APP_NAME }}.homeoffice.gov.uk
- host: supp-docs-stg.prod.{{ .APP_NAME }}.homeoffice.gov.uk
{{ else if eq .KUBE_NAMESPACE .PROD_ENV }}
- host: supp-docs.prod.{{ .APP_NAME }}.homeoffice.gov.uk
{{ end }}
Expand Down