From ea16fa10abdafa840ef4dcd501dce77c0b72bfa4 Mon Sep 17 00:00:00 2001 From: Marcel Date: Thu, 1 Apr 2021 07:33:05 +0000 Subject: [PATCH] use different docker tags for master and nightly runs, This allow us to decouple our test-ci from the release-ci and is necessary for multiple release channels in the future. E.g. we can run a master build without it directly beeing pushed to watchtower and airshipper (config setting requiered on airshipper) Adjust Tags for server-cli --- .gitlab/CI/publish.gitlab-ci.yml | 28 +++++++++++++++++++++++++--- .gitlab/CI/release.yml | 6 +++--- server-cli/docker-compose.yml | 2 +- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/.gitlab/CI/publish.gitlab-ci.yml b/.gitlab/CI/publish.gitlab-ci.yml index ee9a82a86f..407722f225 100644 --- a/.gitlab/CI/publish.gitlab-ci.yml +++ b/.gitlab/CI/publish.gitlab-ci.yml @@ -5,7 +5,16 @@ tags: - veloren-docker rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE != "schedule" + when: always + - when: never + +.publish-nightly: + stage: publish + tags: + - veloren-docker + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH when: always - when: never @@ -20,7 +29,20 @@ docker: - ls "$CI_PROJECT_DIR/server-cli/" script: - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}-server" + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}/server-cli:${CI_COMMIT_REF_NAME}" + +docker-nightly: + extends: .publish-nightly + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + dependencies: + - linux + before_script: + - ls "$CI_PROJECT_DIR/server-cli/" + script: + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/server-cli/Dockerfile --destination "${CI_REGISTRY_IMAGE}/server-cli:nightly" pages: extends: .publish @@ -31,4 +53,4 @@ pages: - rm -rf public - mkdir -p public - cargo doc --no-deps --document-private-items - - mv target/doc/* public + - mv target/doc/* public \ No newline at end of file diff --git a/.gitlab/CI/release.yml b/.gitlab/CI/release.yml index 3de8a59b94..770228a596 100644 --- a/.gitlab/CI/release.yml +++ b/.gitlab/CI/release.yml @@ -9,12 +9,12 @@ - when: manual allow_failure: true -# Template to only run if pushes to master or a tag happened and it being triggered by a schedule +# Template to only run if pushes to master or a tag happened .release: stage: build tags: - veloren-docker rules: - - if: $CI_PIPELINE_SOURCE == "schedule" && ( $CI_COMMIT_REF_NAME =~ /^master$/ || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/ ) + - if: $CI_COMMIT_REF_NAME =~ /^master$/ || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/ when: always - - when: never + - when: never \ No newline at end of file diff --git a/server-cli/docker-compose.yml b/server-cli/docker-compose.yml index 93baaab42a..4f34cfe9a2 100644 --- a/server-cli/docker-compose.yml +++ b/server-cli/docker-compose.yml @@ -2,7 +2,7 @@ version: "3.5" services: game-server: - image: registry.gitlab.com/veloren/veloren:master-server + image: registry.gitlab.com/veloren/veloren/server-cli:nightly container_name: veloren-game-server-master ports: - "14004:14004"