Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a deploy stage #94

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
80 changes: 80 additions & 0 deletions .gitlab-ci.yml
@@ -1,6 +1,7 @@
stages:
- build
- test
- deploy
- status

.build_template: &build_definition
Expand All @@ -17,6 +18,22 @@ stages:
- linux
- nofirewall

deploy_template: &deploy_definition
stage: deploy
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
before_script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
script:
- sh maintainer/docker_build.sh
tags:
- docker
- linux
- nofirewall
only:
- master

.test_template: &test_definition
stage: test
image: $CI_REGISTRY/$CI_PROJECT_PATH/$CI_JOB_NAME-$CI_COMMIT_SHA
Expand Down Expand Up @@ -167,6 +184,69 @@ test/ubuntu-python3:18.04:
test/ubuntu-python3:min_boost:
<<: *test_py3_definition

centos:7:
<<: *deploy_definition
centos-python3:7:
<<: *deploy_definition
centos:next:
<<: *deploy_definition
centos-python3:next:
<<: *deploy_definition
debian:9:
<<: *deploy_definition
opensuse:42.3:
<<: *deploy_definition
opensuse:15.0:
<<: *deploy_definition
opensuse:15.1:
<<: *deploy_definition
ubuntu:16.04:
<<: *deploy_definition
ubuntu:summerschool:
<<: *deploy_definition
ubuntu:18.04:
<<: *deploy_definition
ubuntu:wo-dependencies:
<<: *deploy_definition
clang:6.0:
<<: *deploy_definition
cuda:tutorials:
<<: *deploy_definition
cuda:9.0:
<<: *deploy_definition
rocm:latest:
<<: *deploy_definition
intel:15:
<<: *deploy_definition
tags:
- docker
- linux
- nofirewall
- icp
intel:18:
<<: *deploy_definition
tags:
- docker
- linux
- nofirewall
- icp
ubuntu-python3:16.04:
<<: *deploy_definition
ubuntu-python3:18.04:
<<: *deploy_definition
ubuntu-python3:min_boost:
<<: *deploy_definition
ubuntu:arm64:
<<: *deploy_definition
ubuntu:armhf:
<<: *deploy_definition
ubuntu:i386:
<<: *deploy_definition
ubuntu:ppc64le:
<<: *deploy_definition
ubuntu:s390x:
<<: *deploy_definition

status_success:
stage: status
image: $CI_REGISTRY/espressomd/docker/ubuntu:18.04
Expand Down
10 changes: 8 additions & 2 deletions maintainer/docker_build.sh
Expand Up @@ -18,5 +18,11 @@ cmd "cd docker/$docker_src"
echo "ACTIVATION_LICENSE_FILE=$INTEL_LICENSE_SERVER" >> intel.cfg
echo "ACTIVATION_LICENSE_FILE=$INTEL_LICENSE_SERVER" >> intel-15.cfg
test -f Dockerfile-$docker_tag || cmd "sh generate.sh $docker_tag"
cmd "/kaniko/executor --context $PWD --dockerfile Dockerfile-$docker_tag* --destination $CI_REGISTRY/$CI_PROJECT_PATH/test/$CI_JOB_NAME-$CI_COMMIT_SHA"
test "$CI_COMMIT_REF_NAME" != "master" || cmd "/kaniko/executor --context $PWD --dockerfile Dockerfile-$docker_tag* --destination $CI_REGISTRY/$CI_PROJECT_PATH/$CI_JOB_NAME"

if [ "$CI_JOB_STAGE" = "deploy" ]; then
dest=$CI_JOB_NAME
else
dest=test/$CI_JOB_NAME-$CI_COMMIT_SHA
mkuron marked this conversation as resolved.
Show resolved Hide resolved
fi

cmd "/kaniko/executor --context $PWD --dockerfile Dockerfile-$docker_tag* --destination $CI_REGISTRY/$CI_PROJECT_PATH/$dest"