Skip to content
Snippets Groups Projects
Commit 23e55e79 authored by Aaron Spring's avatar Aaron Spring :baby_symbol:
Browse files

Merge branch 'CI_notebooks' into 'master'

CI notebooks

- run verification notebook in CI
- use docker image pushed
- should only run for this repo and not automatically in all forks: add check if repo name `aaron.spring/s2s-ai-challenge-template` only

closes #8

See merge request aaron.spring/s2s-ai-challenge-template!11
parents 511b33be b1fd395f
No related branches found
No related tags found
No related merge requests found
...@@ -5,13 +5,55 @@ variables: ...@@ -5,13 +5,55 @@ variables:
stages: stages:
- build - build
- test
image_build: image_build:
stage: build stage: build
image: docker:stable image: docker:stable
except:
- merge_requests
before_script: before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN http://$CI_REGISTRY - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN http://$CI_REGISTRY
script: | script: |
CI_COMMIT_SHA_7=$(echo $CI_COMMIT_SHA | cut -c1-7) CI_COMMIT_SHA_7=$(echo $CI_COMMIT_SHA | cut -c1-7)
docker build --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 . docker build --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 .
docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7 docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA_7
\ No newline at end of file
merge_request_build:
stage: build
image: docker:stable
only:
- merge_requests
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN http://$CI_REGISTRY
script: |
docker build --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-MR .
docker push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-MR
merge_request_test:
stage: test
image:
name: ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHORT_SHA}-MR
entrypoint: ['']
only:
- merge_requests
except:
# shouldnt run on forks automatically
- $PWD != /builds/gitlab/aaron.spring/s2s-ai-challenge-template/
before_script:
# install
- pip install pytest nbmake
# clone the project
- cd /tmp
- renku clone ${CI_REPOSITORY_URL}
- cd ${CI_PROJECT_NAME}
- echo "Source branch = ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}, Target branch = ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}"
# checkout to the source branch
- git checkout ${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
# pull lfs
- renku storage pull data/forecast-like-observations_2020_biweekly_terciled.nc
- renku storage pull submissions/ML_prediction_2020.nc
- renku storage pull data/ecmwf_recalibrated_benchmark_2020_biweekly_terciled.nc
script:
# testing notebook
- pytest --nbmake notebooks/RPSS_verification.ipynb
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment