stages: - test - testContainer - build - deploy build_test_project: stage: test # Please notice that we are using a different image just for easier syntax in the testing of the building and # testing of the repository image: continuumio/miniconda3:latest script: - . /opt/conda/etc/profile.d/conda.sh - conda env create -f environment.yml - conda activate escape_template - python setup.py install - pytest . test_docker_registry: stage: testContainer image: gitlab-registry.in2p3.fr/escape2020/wp3/template_project_escape/escape_template_project:v1.0 script: - source activate escape_template - square_number -i -12.5 only: - tags build_image: stage: build image: singularityware/singularity:gitlab-2.6 script: # Build the container! - /bin/bash .gitlabci/build.sh Singularity - mkdir -p build && cp *.simg build - mkdir -p build && cp Singularity* build artifacts: paths: - build/Singularity.simg - build/Singularity only: # - master - tags deploy_zenodo: stage: deploy image: python:3.6.11-buster dependencies: - build_image script: # 1 - Install dependencies in the image and upload the files to Zenodo - apt-get -y update ### python, pip and wget are already installed in the container #- cat /etc/os-release # Debian GNU/Linux 10 (buster) #- pip3 --version # pip 20.1.1 #- python3 --version # 3.6.11 as the tag of the image specifies - pip3 install requests ### 2 - Get the last tag/release of the repository - export REPOSITORY_NAME=template_project_escape - export REPOSITORY_URL=https://gitlab.in2p3.fr/escape2020/wp3/$REPOSITORY_NAME ### 3 - Download the repository and move it to the build directory - mkdir -p build - /bin/bash .zenodoci/parse_last_release.sh $REPOSITORY_NAME $REPOSITORY_URL - ls ./build ### 4 - To deploy a NEW DEPOSIT to ZENODO SANDBOX #- > # python3 .zenodoci/upload_new_deposit.py # --token $SANDBOX_ZENODO_TOKEN # --sandbox_zenodo True # --input-directory ./build ### 4 - To deploy a NEW DEPOSIT to ZENODO #- > # python3 .zenodoci/upload_new_deposit.py # --token $ZENODO_TOKEN # --sandbox_zenodo False # --input-directory ./build ### 4 - To deploy a NEW VERSION to ZENODO: The deposit_id of the entry to be `new_versioned` MUST be provided. - > python3 .zenodoci/upload_new_version_deposit.py --sandbox_zenodo False --token $ZENODO_TOKEN --deposit_id $DEPOSIT_ID_ESCAPE_TEMPLATE only: - tags