diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a09af34c66886a24d0de07869cd610bc57e8d58a..a3be5240cf408906f06f42811c9a83946214f2b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,9 +9,7 @@ variables: stages: - - docker - build-singularity - - upload-singularity cache: @@ -21,94 +19,6 @@ cache: key: "$CI_COMMIT_REF_SLUG" -.virtualenv_template: &virtualenv_definition | - python -V - pip install -U pip setuptools wheel virtualenv - virtualenv venv - source venv/bin/activate - make install-dev - -test: - image: docker.km3net.de/base/python:3.6 - stage: test - script: - - *virtualenv_definition - - pip list - - make test - - -coverage: - image: docker.km3net.de/base/python:3.6 - stage: coverage - script: - - *virtualenv_definition - - "make test-cov|grep TOTAL| awk '{printf \"COVERAGE: %.2f%%\", (1-$3/$2)*100 }'" - coverage: '/COVERAGE:\s*([0-9]*\.[0-9]*%)/' - artifacts: - paths: - - reports/coverage - - -pages: - image: docker.km3net.de/base/python:3.6 - stage: doc - script: - - *virtualenv_definition - - cd docs && make html - - mv _build/html/ ../public/ - - cd .. && mv reports/coverage public/coverage - artifacts: - paths: - - public - cache: {} - only: - - tags - - master - - -docker: - image: docker:stable - services: - - docker:dind - stage: docker - script: - - docker build --pull -t $CONTAINER_TEST_IMAGE . - - docker push $CONTAINER_TEST_IMAGE - tags: - - docker - only: - - tags - - -pypi: - image: docker.km3net.de/base/python:3.6 - stage: release - cache: {} - script: - - pip install -U twine - - python setup.py sdist - - twine upload dist/* - only: - - tags - - -release-image: - image: docker:stable - services: - - docker:dind - stage: release - script: - - docker pull $CONTAINER_TEST_IMAGE - - docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE - - docker tag $CONTAINER_TEST_IMAGE $CONTAINER_LATEST_IMAGE - - docker push $CONTAINER_RELEASE_IMAGE - - docker push $CONTAINER_LATEST_IMAGE - tags: - - docker - only: - - tags - - build-singularity: image: docker.km3net.de/base/singularity:3.1 stage: build-singularity @@ -121,6 +31,3 @@ build-singularity: - touch ~/.ssh/known_hosts - ssh-keyscan -H $KM3NET_SFTP_HOST >> ~/.ssh/known_hosts - lftp -u $KM3NET_SFTP_USER,$KM3NET_SFTP_PASSWORD sftp://$KM3NET_SFTP_HOST -e "set ssl:verify-certificate no; cd singularity/; put $SINGULARITY_IMAGE; bye" - - tags: - - docker