Skip to content
Snippets Groups Projects
.gitlab-ci.yml 970 B
Newer Older
Athanasios Karmas's avatar
Athanasios Karmas committed
stages:
  - deploy
Athanasios Karmas's avatar
Athanasios Karmas committed

variables:


deploy-artifacts:
  stage: deploy
  before_script:
    - tar czvf binaryArtifacts.tar.gz ${CI_PROJECT_DIR}/jobs_scratch_dir/mirror/build_cache/*
    - 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