diff --git a/.drone.yml b/.drone.yml index b2263389..61d2b27c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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 @@ -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 @@ -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: diff --git a/bin/deploy.sh b/bin/deploy.sh index a7836e4d..3f5733aa 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -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 diff --git a/kube/app/ingress-internal.yml b/kube/app/ingress-internal.yml index 78d20b67..76f7f6c3 100644 --- a/kube/app/ingress-internal.yml +++ b/kube/app/ingress-internal.yml @@ -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 diff --git a/kube/file-vault/file-vault-ingress.yml b/kube/file-vault/file-vault-ingress.yml index d1793813..d3681406 100644 --- a/kube/file-vault/file-vault-ingress.yml +++ b/kube/file-vault/file-vault-ingress.yml @@ -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 }} @@ -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 }}