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:
- local: .gitlab/CI/recompile.yml
- local: .gitlab/CI/release.yml
- local: .gitlab/CI/optional-builds.gitlab-ci.yml
- local: .gitlab/CI/check-compile.gitlab-ci.yml
- local: .gitlab/CI/build-post.gitlab-ci.yml

View File

@ -39,9 +39,8 @@ localization-status:
# Artifacts
.artifact: &artifact
extends: .recompile
extends: .release
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:
- veloren-docker

View File

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