Skip to content
Snippets Groups Projects
Commit 2e2ce5e6 authored by Z.J. van de Weg's avatar Z.J. van de Weg
Browse files

Rename variables for 9.0

GitLab will change the name of variables in 9.0[1], so the template
needed an update. In these cases mostly CI_BUILD_REF_NAME to
CI_COMMIT_REF_NAME.

[1] https://docs.gitlab.com/ce/ci/variables/#9-0-renaming
parent 4e50314b
No related branches found
No related tags found
1 merge request!59Rename variables for 9.0
Pipeline #
Loading
Loading
@@ -7,7 +7,7 @@ services:
build:
stage: build
script:
- export IMAGE_TAG=$(echo -en $CI_BUILD_REF_NAME | tr -c '[:alnum:]_.-' '-')
- docker login -u "gitlab-ci-token" -p "$CI_BUILD_TOKEN" $CI_REGISTRY
- export IMAGE_TAG=$(echo -en $CI_COMMIT_REF_NAME | tr -c '[:alnum:]_.-' '-')
- docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
- docker build --pull -t "$CI_REGISTRY_IMAGE:$IMAGE_TAG" .
- docker push "$CI_REGISTRY_IMAGE:$IMAGE_TAG"
Loading
Loading
@@ -3,9 +3,9 @@
# For docker image tags see https://hub.docker.com/_/maven/
#
# For general lifecycle information see https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
#
#
# This template will build and test your projects as well as create the documentation.
#
#
# * Caches downloaded dependencies and plugins between invocation.
# * Does only verify merge requests but deploy built artifacts of the
# master branch.
Loading
Loading
@@ -24,12 +24,12 @@ variables:
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
 
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_BUILD_REF_NAME"'
# To keep cache across branches add 'key: "$CI_JOB_REF_NAME"'
cache:
paths:
- .m2/repository
 
# This will only validate and compile stuff and run e.g. maven-enforcer-plugin.
# This will only validate and compile stuff and run e.g. maven-enforcer-plugin.
# Because some enforcer rules might check dependency convergence and class duplications
# we use `test-compile` here instead of `validate`, so the correct classpath is picked up.
.validate: &validate
Loading
Loading
Loading
Loading
@@ -38,11 +38,11 @@ review:
<<: *deploy
stage: review
variables:
APP: $CI_BUILD_REF_NAME
APP_HOST: $CI_PROJECT_NAME-$CI_BUILD_REF_NAME.$OPENSHIFT_DOMAIN
APP: $CI_COMMIT_REF_NAME
APP_HOST: $CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.$OPENSHIFT_DOMAIN
environment:
name: review/$CI_BUILD_REF_NAME
url: http://$CI_PROJECT_NAME-$CI_BUILD_REF_NAME.$OPENSHIFT_DOMAIN
name: review/$CI_COMMIT_REF_NAME
url: http://$CI_PROJECT_NAME-$CI_COMMIT_REF_NAME.$OPENSHIFT_DOMAIN
on_stop: stop-review
only:
- branches
Loading
Loading
@@ -56,10 +56,10 @@ stop-review:
- oc delete all -l "app=$APP"
when: manual
variables:
APP: $CI_BUILD_REF_NAME
APP: $CI_COMMIT_REF_NAME
GIT_STRATEGY: none
environment:
name: review/$CI_BUILD_REF_NAME
name: review/$CI_COMMIT_REF_NAME
action: stop
only:
- branches
Loading
Loading
Loading
Loading
@@ -53,7 +53,7 @@ review:
script:
- command deploy
environment:
name: review/$CI_BUILD_REF_NAME
name: review/$CI_COMMIT_REF_NAME
url: http://$CI_ENVIRONMENT_SLUG.$KUBE_DOMAIN
on_stop: stop_review
only:
Loading
Loading
@@ -68,7 +68,7 @@ stop_review:
script:
- command destroy
environment:
name: review/$CI_BUILD_REF_NAME
name: review/$CI_COMMIT_REF_NAME
action: stop
when: manual
only:
Loading
Loading
# Explaination on the scripts:
# Explanation on the scripts:
# https://gitlab.com/gitlab-examples/openshift-deploy/blob/master/README.md
image: registry.gitlab.com/gitlab-examples/openshift-deploy
 
Loading
Loading
@@ -53,7 +53,7 @@ review:
script:
- command deploy
environment:
name: review/$CI_BUILD_REF_NAME
name: review/$CI_COMMIT_REF_NAME
url: http://$CI_ENVIRONMENT_SLUG.$KUBE_DOMAIN
on_stop: stop_review
only:
Loading
Loading
@@ -68,7 +68,7 @@ stop_review:
script:
- command destroy
environment:
name: review/$CI_BUILD_REF_NAME
name: review/$CI_COMMIT_REF_NAME
action: stop
when: manual
only:
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment