Unverified Commit 6a5c6050 authored by Kamal Dodiya's avatar Kamal Dodiya Committed by GitHub
Browse files

[ENSWBSITES-648] CI/CD job to publish static assets to k8s PVC (#528)

parent 0ebb4ac3
Pipeline #176001 passed with stages
in 4 minutes and 50 seconds
......@@ -36,12 +36,17 @@ variables:
- npm run test
- npm run build
after_script:
- echo "BUILD_JOB_ID=${CI_JOB_ID}" >> build_static.env
artifacts:
name: build_artifacts
paths:
- src/ensembl/dist/
- src/ensembl/package.json
- src/ensembl/package-lock.json
- src/ensembl/dist/
- src/ensembl/package.json
- src/ensembl/package-lock.json
reports:
dotenv: build_static.env
# Template to build nginx docker image for WP k8s cluster
# WP k8s cluster uses ingress
......@@ -66,6 +71,23 @@ variables:
- docker rmi ${CONTAINER_IMAGE}
- docker logout $CI_REGISTRY
.publish_assets:
image: dockerhub.ebi.ac.uk/ensembl-web/deploy-tools:0.5
stage: deploy
environment:
name : jobs/k8s-job
before_script:
- git clone https://gitlab.ebi.ac.uk/ensembl-web/ensembl-k8s-manifests.git
- git -C ensembl-k8s-manifests/ checkout wp-k8s
- cd ensembl-k8s-manifests
script:
- sed -i "s#<PROJECT_ID>#${CI_PROJECT_ID}#g" static_assets_copy_job.yaml
- sed -i "s#<JOB_ID>#${BUILD_JOB_ID}#g" static_assets_copy_job.yaml
- kustomize edit set namesuffix -- -${CI_PROJECT_ID}-${BUILD_JOB_ID}
- kubectl apply -k .
# Template to build node docker image for WP k8s cluster
# WP k8s cluster uses ingress
.build-node:
......@@ -286,6 +308,16 @@ Staging:HX:
- Nginx:Staging
- Node:Staging
Pub:Staging-HX:
extends: .publish_assets
environment:
name : wp-hx-staging
only:
- dev
needs:
- Test_N_Build
- Node:Staging
# Job to deploy to staging environment (WP-HL k8s cluster)
Staging:HL:
extends: .deploy
......@@ -298,6 +330,16 @@ Staging:HL:
- Nginx:Staging
- Node:Staging
Pub:Staging-HL:
extends: .publish_assets
environment:
name : wp-hh-staging
only:
- dev
needs:
- Test_N_Build
- Node:Staging
# Job to deploy to live environment (WP-HX k8s cluster)
Live:HX:
extends: .deploy
......@@ -313,6 +355,16 @@ Live:HX:
- Nginx:Live
- Node:Live
Pub:Live-HX:
extends: .publish_assets
environment:
name : wp-hx-live
only:
- master
needs:
- Test_N_Build
- Node:Live
# Job to deploy to live environment (WP-HL k8s cluster)
Live:HL:
extends: .deploy
......@@ -328,6 +380,16 @@ Live:HL:
- Nginx:Live
- Node:Live
Pub:Live-HL:
extends: .publish_assets
environment:
name : wp-hh-live
only:
- master
needs:
- Test_N_Build
- Node:Live
# Job to deploy to internal environment (WP-HX k8s cluster)
Internal:HX:
extends: .deploy
......@@ -343,6 +405,16 @@ Internal:HX:
- Nginx:Internal
- Node:Internal
Pub:Internal-HX:
extends: .publish_assets
environment:
name : wp-hx-internal
only:
- master
needs:
- Test_N_Build:internal
- Node:Internal
# Job to deploy to internal environment (WP-HL k8s cluster)
Internal:HL:
extends: .deploy
......@@ -358,6 +430,16 @@ Internal:HL:
- Nginx:Internal
- Node:Internal
Pub:Internal-HL:
extends: .publish_assets
environment:
name : wp-hh-internal
only:
- master
needs:
- Test_N_Build:internal
- Node:Internal
Review:HX:
extends: .deploy-review
variables:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment