Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit d0251259 authored by Enrique Garcia's avatar Enrique Garcia
Browse files

Merge branch 'eossr_ci' into 'master'

update CI with latest eossr one

See merge request !20
parents dee7462d c8a8b2f1
Pipeline #147604 passed with stages
in 2 minutes and 5 seconds
stages:
- install
- test
- build
- build_container
- deploy
install_project:
......@@ -40,26 +40,27 @@ test_docker_registry:
- master
- tags
build_singularity_image:
# Example of Singularity image (of the project) built during the CI
stage: build
stage: build_container
image: singularityware/singularity:gitlab-2.6
script:
# Build the container!
- /bin/bash .singularityci/build.sh Singularity/Singularity
# You should have added before your Singularity recipe in a Singularity dir
- export IMAGE_NAME=$CI_PROJECT_NAME
- singularity build $IMAGE_NAME.simg Singularity/Singularity
- mkdir -p build && cp Singularity/*.simg build
- mkdir -p build && cp Singularity/Singularity* build
- mkdir -p singularity_build && cp *.simg singularity_build
- mkdir -p singularity_build && cp Singularity/Singularity singularity_build
- ls singularity_build
artifacts:
paths:
- build/Singularity.simg
- build/Singularity
- singularity_build/Singularity.simg
- singularity_build/Singularity
only:
- tags
build_docker_image:
# Example of Docker container (of the project) built - and uploaded to a registry - during the CI
stage: build
stage: build_container
image: docker:19.03.12
services:
- docker:19.03.12-dind
......@@ -70,37 +71,37 @@ build_docker_image:
- echo $LAST_RELEASE
script:
- cd Docker
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
- docker build -t $CI_REGISTRY_IMAGE:$LAST_RELEASE .
- docker push $CI_REGISTRY_IMAGE:$LAST_RELEASE
# --> The following code snippet IS just an exploratory / WIP section
# Save docker image into a file to be uploaded in next stage
- docker save -o Docker_image_ESCAPE_template_project_$LAST_RELEASE.tar $CI_REGISTRY_IMAGE:$LAST_RELEASE
- ls
- cd .. && mkdir -p build && cp Docker/*.tar build
- ls build
- docker save -o Docker_${CI_PROJECT_NAME}_$LAST_RELEASE.tar $CI_REGISTRY_IMAGE:$LAST_RELEASE
- cd .. && mkdir -p /docker_build && cp Docker/*.tar /docker_build
- ls /docker_build
artifacts:
paths:
- build/Docker_image_ESCAPE_template_project_*.tar
- /docker_build/Docker_*.tar
only:
- tags
deploy_zenodo:
stage: deploy
image: gitlab-registry.in2p3.fr/escape2020/wp3/zenodoci:v1.2
# The `dependencies` key (and field) is added to this stage ONLY because we have created in a previous stage some other artifacts
image: gitlab-registry.in2p3.fr/escape2020/wp3/eossr:latest
# The `dependencies` key (and field) is added to this stage ONLY because we have created
# in previous stages some artifacts
dependencies:
- build_singularity_image
- build_docker_image
before_script:
- test_connection_zenodo --token $ZENODO_TOKEN --sandbox False -p $CI_PROJECT_DIR
script:
- mkdir -p build
- parse_last_release_git.sh $CI_PROJECT_NAME $CI_PROJECT_URL
- if [[ -f ./codemeta.json ]]; then cp ./codemeta.json ./build; fi
- ls ./build
- gitlab_prepare_upload_zenodo.sh $CI_PROJECT_NAME $CI_PROJECT_DIR zenodo_build
- cp /docker_build/* zenodo_build
- cp /singularity_build/* zenodo_build
- ls zenodo_build
- upload_new_version_deposit -t $ZENODO_TOKEN -s False -i ./build -id $ZENODO_PROJECT_ID
- eossr-upload-repository -t $ZENODO_TOKEN -s False -i zenodo_build -id $ZENODO_RECORD_ID
only:
- tags
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment