diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 235b5d59bf9..fe7a8ccd2e6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,6 +15,12 @@ # DOCKER_HUB_ACCESS_KEY: Access Key or Password of the docker user # # +# DESY env: we use rancher2 based cluster. User rancher cli to create namespace to bind to the project +# +# RANCHER_SERVER: rancher server endpoint +# RANCHER_TOKEN: rancher access token +# RANCHER_CONTEXT: associated rancher project +# # # KUBECONFIG: env file that contains kubernetes configuration to access the cluster # @@ -69,7 +75,13 @@ default: .kubernetes_image: extends: .kubernetes_tags image: bitnami/kubectl:latest - + +.rancher_image: + extends: .kubernetes_tags + image: rancher/cli2 + before_script: + - rancher login ${RANCHER_SERVER} --token ${RANCHER_TOKEN} --context ${RANCHER_CONTEXT} + .helm_image: extends: .kubernetes_tags image: @@ -321,10 +333,9 @@ upload_container: # prepare_k8s_env: stage: testenv_pre - extends: .kubernetes_image + extends: .rancher_image script: - - kubectl create namespace ${K8S_NAMESPACE} - + - rancher namespaces create ${K8S_NAMESPACE} # # collect all logs @@ -348,12 +359,12 @@ collect_logs: # cleanup_k8s_env: stage: testenv_post - extends: .kubernetes_image + extends: .rancher_image needs: - collect_logs when: always script: - - kubectl delete namespace ${K8S_NAMESPACE} --grace-period=1 --ignore-not-found=true + - rancher namespaces delete ${K8S_NAMESPACE} # # infrastructure required to run dCache @@ -470,4 +481,4 @@ pynfs_tests: artifacts: reports: junit: - - "xunit*.xml" \ No newline at end of file + - "xunit*.xml"