Skip to content
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
47 changes: 44 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ variables:
- kustomize edit set image DOCKER_IMAGE=${DOCKER_IMAGE}
- kubectl apply -k .

.deploy-nginx-template:
<<: *prepare-context
script:
- cd k8s/frontend/nginx/
- kustomize edit set image DOCKER_IMAGE=${DOCKER_IMAGE}
- kubectl apply -k .

# template for deploy the configmap used by the backend backend
# update docker image in appropriate environment
.deploy-config-be-template:
Expand All @@ -78,7 +85,7 @@ variables:

# template for deploy context for frontend
# publish static assets to appropriate environment
.deploy-fe-template:
.publish-assets-template:
<<: *prepare-context
script:
- cd k8s/frontend/
Expand Down Expand Up @@ -158,7 +165,7 @@ Deploy:BE-Config:RC:

# Publish static assets to QA environment
Publish:Assets:RC:
extends: .deploy-fe-template
extends: .publish-assets-template
stage: deploy_rc
<<: *fe-code-change-rules
environment:
Expand Down Expand Up @@ -230,7 +237,7 @@ Deploy:BE-config:Live:
# This is manual step it explicitly needs to be triggered by pressing a button in gitlab interface
# The job is scheduled only for main branch and when deploy freeze is not in place
Publish:Assets:Live:
extends: .deploy-fe-template
extends: .publish-assets-template
stage: deploy
<<: *fe-code-change-rules
environment:
Expand All @@ -243,3 +250,37 @@ Publish:Assets:Live:
changes:
- frontend/**/*
when: manual

# Deploy Nginx to Live to serve static assets
# This is manual step it explicitly needs to be triggered by pressing a button in gitlab interface
# The job is scheduled only for main branch and when deploy freeze is not in place
Deploy:Nginx:Live:
stage: deploy
extends: .deploy-nginx-template
<<: *static-code-change-rules
image: dockerhub.ebi.ac.uk/ensembl-web/deploy-tools:1.0.4
environment:
name: production
variables:
AGENT: ${PROD_AGENT}
NS: amr
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-fe
rules:
- if: '$CI_DEPLOY_FREEZE == null && $CI_COMMIT_BRANCH == "nda2"'
changes:
- frontend/**/*
when: manual

# Deploy Nginx to RC to serve static assets
# The job is scheduled only for main branch
Deploy:Nginx:RC:
stage: deploy_rc
extends: .deploy-nginx-template
<<: *static-code-change-rules
image: dockerhub.ebi.ac.uk/ensembl-web/deploy-tools:1.0.4
environment:
name: development
variables:
AGENT: ${REVIEW_AGENT}
NS: amr
DOCKER_IMAGE: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-fe
2 changes: 1 addition & 1 deletion frontend/nginx-conf/local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
server {
listen 8000;
server_name localhost;
root /usr/assets/dist; # Directory containing static files

location / {
root /usr/assets/dist; # Directory containing static files
index index.html index.htm;
try_files $uri $uri/ =404; # Serve 404 if file not found
}
Expand Down
Empty file added k8s/backend/todo
Empty file.
5 changes: 4 additions & 1 deletion k8s/frontend/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- publish_assets.yaml
- nginx/pvc.yaml
- nginx/service.yaml
- nginx/deployment.yaml
- nginx/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
imagePullSecrets:
- name: ensemblweb-pull-secret
containers:
- image: dockerhub.ebi.ac.uk/ensembl-web/amr-portal:d9bf511d-fe
- image: DOCKER_IMAGE
imagePullPolicy: Always
name: amr-portal-nginx
ports:
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions k8s/frontend/nginx/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions k8s/frontend/publish_assets/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- publish_assets.yaml