From 24c9e9b1100622a1239165df1a6413b0cda48661 Mon Sep 17 00:00:00 2001 From: Athanasios Karmas <karmas@athenarc.gr> Date: Fri, 9 Jul 2021 15:02:35 +0000 Subject: [PATCH] Update .gitlab-ci.yml --- .gitlab-ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 147d3e38..4f18e29d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,6 +17,7 @@ default: stages: - generate - build + - deploy # UHEI spack version and branch variables: @@ -55,3 +56,30 @@ build-jobs: - artifact: "jobs_scratch_dir/pipeline.yml" job: generate-pipeline strategy: depend + artifacts: + paths: + - "${CI_PROJECT_DIR}/binary_artifacts.tar.gz + +deploy-artifacts: + stage: deploy + before_script: + - oc login "$OPENSHIFT_SERVER" --token="$OPENSHIFT_TOKEN" + script: + # create job description file + - chmod a+x create_job.sh + - ./create_job.sh $CAT_URL $CAT_ART_NAME $CAT_SRC_DIR $CAT_DEST_DIR + - cat simplejob.yml + # select the project in openshift + - oc project jupyterhub-dev + # delete the job (if exist) + - oc delete job simplejob || true + # start the deploy job + - oc create -f simplejob.yml + # wait for job to finish https://stackoverflow.com/questions/5073453wait-for-kubernetes-job-to-complete-on-either-failure-success-using-command-line + - oc get job/simplejob -o=jsonpath='{.status}' -w + - oc get job/simplejob -o=jsonpath='{.status.conditions[*].type}' | grep -i -E 'failed|complete' || echo 'Failed' + tags: + - shell-runner + + + -- GitLab