From d703b19707cac2c54ceded3673c3642dc0d55666 Mon Sep 17 00:00:00 2001
From: Eleni Mathioulaki <emathioulaki@athenarc.gr>
Date: Mon, 29 Jul 2024 05:16:27 +0200
Subject: [PATCH] feat: add build jobs for prod JSC cluster

---
 .gitlab-ci.yml | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 502fc82f..68f511b7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -98,6 +98,27 @@ deploy-prod-release-prod-cscs:
     SPACK_ENV: ebrains-24-04
     RELEASE_NAME: EBRAINS-24.04
   resource_group: shared-NFS-mount-prod-cscs
+  tags:             # this is just to ensure that the two jobs will run on different runners
+    - read-write    # to avoid issues with common environment variables
+    - shell-runner
+  rules:
+    - if: $CI_COMMIT_BRANCH =~ /^ebrains/
+      when: manual
+
+# Deploy the production release of tools (manual pipeline)
+# deploy on the prod environment of the k8s prod cluster at JSC
+# runs on protected branches only as the token variable is protected
+deploy-prod-release-prod-jsc:
+  extends: .deploy-build-environment
+  variables:
+    OPENSHIFT_SERVER: $JSC_K8S_PROD_SERVER
+    OPENSHIFT_TOKEN: $JSC_K8S_PROD_TOKEN
+    OC_PROJECT: jupyterhub
+    LAB_KERNEL_ROOT: /srv/jupyterlab_kernels/prod
+    INSTALLATION_ROOT: /srv/main-spack-instance-2402
+    SPACK_ENV: ebrains-24-04
+    RELEASE_NAME: EBRAINS-24.04
+  resource_group: shared-NFS-mount-prod-jsc
   rules:
     - if: $CI_COMMIT_BRANCH =~ /^ebrains/
       when: manual
@@ -161,6 +182,28 @@ deploy-exp-release-prod-cscs:
     SPACK_ENV: experimental
     RELEASE_NAME: EBRAINS-experimental
   resource_group: shared-NFS-mount-prod-cscs
+  tags:             # this is just to ensure that the two jobs will run on different runners
+    - read-write    # to avoid issues with common environment variables
+    - shell-runner
+  rules:
+    - if: $CI_PIPELINE_SOURCE == "schedule"  && $DEPLOYMENT == "prod"
+
+# Deploy the experimental release of tools (sheduled pipeline)
+# once a week from latest working version of integration release 
+# (branch=experimental_release) to an experimental JupyterLab kernel
+# deploy on the prod environment of the k8s prod cluster at JSC
+# runs on protected branches only as the token variable is protected
+deploy-exp-release-prod-jsc:
+  extends: .deploy-build-environment
+  variables:
+    OPENSHIFT_SERVER: $JSC_K8S_PROD_SERVER
+    OPENSHIFT_TOKEN: $JSC_K8S_PROD_TOKEN
+    OC_PROJECT: jupyterhub
+    LAB_KERNEL_ROOT: /srv/jupyterlab_kernels/prod
+    INSTALLATION_ROOT: /srv/main-spack-instance-2402
+    SPACK_ENV: experimental
+    RELEASE_NAME: EBRAINS-experimental
+  resource_group: shared-NFS-mount-prod-jsc
   rules:
     - if: $CI_PIPELINE_SOURCE == "schedule"  && $DEPLOYMENT == "prod"
 
-- 
GitLab