change(ci): centralise master/tag push check

This commit is contained in:
Songtronix 2020-05-18 19:32:21 +02:00
parent ce7eced0b3
commit 507086fac6
4 changed files with 7 additions and 9 deletions

View File

@ -38,6 +38,7 @@ before_script:
include: include:
- local: .gitlab/CI/recompile.yml - local: .gitlab/CI/recompile.yml
- local: .gitlab/CI/release.yml
- local: .gitlab/CI/optional-builds.gitlab-ci.yml - local: .gitlab/CI/optional-builds.gitlab-ci.yml
- local: .gitlab/CI/check-compile.gitlab-ci.yml - local: .gitlab/CI/check-compile.gitlab-ci.yml
- local: .gitlab/CI/build-post.gitlab-ci.yml - local: .gitlab/CI/build-post.gitlab-ci.yml

View File

@ -39,9 +39,8 @@ localization-status:
# Artifacts # Artifacts
.artifact: &artifact .artifact: &artifact
extends: .recompile extends: .recompile
extends: .release
stage: build-post stage: build-post
rules:
- if: $CI_COMMIT_REF_NAME =~ /^master.$/ || $CI_COMMIT_TAG =~ /^r[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+/
tags: tags:
- veloren-docker - veloren-docker

View File

@ -1,7 +1,6 @@
docker: docker:
stage: publish stage: publish
when: delayed extends: .release
start_in: 5 seconds
image: image:
name: gcr.io/kaniko-project/executor:debug name: gcr.io/kaniko-project/executor:debug
entrypoint: [""] entrypoint: [""]
@ -9,11 +8,6 @@ docker:
- linux - linux
before_script: before_script:
- ls "$CI_PROJECT_DIR/server-cli/" - ls "$CI_PROJECT_DIR/server-cli/"
only:
refs:
- /^r[0-9]+\.[0-9]+\.[0-9]+/
- /^v[0-9]+\.[0-9]+/
- /^master$/
tags: tags:
- veloren-docker - veloren-docker
script: script:

4
.gitlab/CI/release.yml Normal file
View File

@ -0,0 +1,4 @@
# Template to only run if pushes to master or a tag happened
.release:
rules:
- if: $CI_COMMIT_REF_NAME =~ /^master.$/ || $CI_COMMIT_TAG =~ /^r[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+/