Skip to content
Snippets Groups Projects
Verified Commit cdf088b2 authored by Chris Coley's avatar Chris Coley
Browse files

Try moving the 'variables' directive to the job template

parent 9949eb5a
Branches
No related tags found
2 merge requests!5Variable substitution,!4Variable overriding
...@@ -14,10 +14,14 @@ workflow: ...@@ -14,10 +14,14 @@ workflow:
stage: deploy stage: deploy
tags: tags:
- docker - docker
variables:
ROOT_RELATIVE_NAMESPACE: "${CI_PROJECT_NAMESPACE#$CI_PROJECT_ROOT_NAMESPACE}"
script: script:
- sed -i "s/%%BRANCH%%/$CI_COMMIT_BRANCH/g" src/index.html - sed -i "s/%%BRANCH%%/$CI_COMMIT_BRANCH/g" src/index.html
- mv src public - mv src public
- echo $SHELL - echo $SHELL
- echo $ROOT_RELATIVE_NAMESPACE
- echo $CI_ENVIRONMENT_URL
- printenv - printenv
artifacts: artifacts:
paths: paths:
...@@ -29,8 +33,6 @@ review: ...@@ -29,8 +33,6 @@ review:
extends: .deploy extends: .deploy
rules: rules:
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH
variables:
ROOT_RELATIVE_NAMESPACE: "${CI_PROJECT_NAMESPACE#$CI_PROJECT_ROOT_NAMESPACE}"
environment: environment:
name: "review $CI_COMMIT_BRANCH" name: "review $CI_COMMIT_BRANCH"
url: "https://${CI_PROJECT_ROOT_NAMESPACE}.${CI_PAGES_DOMAIN}/-${ROOT_RELATIVE_NAMESPACE}/${CI_PROJECT_NAME}/-/jobs/$CI_JOB_ID/artifacts/public/index.html" url: "https://${CI_PROJECT_ROOT_NAMESPACE}.${CI_PAGES_DOMAIN}/-${ROOT_RELATIVE_NAMESPACE}/${CI_PROJECT_NAME}/-/jobs/$CI_JOB_ID/artifacts/public/index.html"
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment