From 111e17e356e321b23d0ab965d97982aea93c5b40 Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 15 Jan 2017 17:32:54 +0000 Subject: [PATCH 1/2] Actually use `$CI_ENVIRONMENT_SLUG` in the `environment:url` --- doc/ci/environments.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ci/environments.md b/doc/ci/environments.md index 98cd29c9567..dfd7c2b8022 100644 --- a/doc/ci/environments.md +++ b/doc/ci/environments.md @@ -297,7 +297,7 @@ deploy_review: - echo "Deploy a review app" environment: name: review/$CI_BUILD_REF_NAME - url: https://$CI_BUILD_REF_SLUG.review.example.com + url: https://$CI_ENVIRONMENT_SLUG.review.example.com only: - branches except: From 5d69ea265ed5569c542ac34038f6d9701584e64e Mon Sep 17 00:00:00 2001 From: Vincent Tunru Date: Fri, 27 Jan 2017 12:12:47 +0100 Subject: [PATCH 2/2] Use consistent URLs for review apps in the docs It said `.review.example.com` at one place, `review-.example.com` elsewhere, and no mention of `review` at all in other places. We now leave out `review` everywhere. --- doc/ci/environments.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/ci/environments.md b/doc/ci/environments.md index dfd7c2b8022..ef04c537367 100644 --- a/doc/ci/environments.md +++ b/doc/ci/environments.md @@ -297,7 +297,7 @@ deploy_review: - echo "Deploy a review app" environment: name: review/$CI_BUILD_REF_NAME - url: https://$CI_ENVIRONMENT_SLUG.review.example.com + url: https://$CI_ENVIRONMENT_SLUG.example.com only: - branches except: @@ -318,15 +318,15 @@ also contain `/`, or other characters that would be invalid in a domain name or URL, we use `$CI_ENVIRONMENT_SLUG` in the `environment:url` so that the environment can get a specific and distinct URL for each branch. In this case, given a `$CI_BUILD_REF_NAME` of `100-Do-The-Thing`, the URL will be something -like `https://review-100-do-the-4f99a2.example.com`. Again, the way you set up +like `https://100-do-the-4f99a2.example.com`. Again, the way you set up the web server to serve these requests is based on your setup. You could also use `$CI_BUILD_REF_SLUG` in `environment:url`, e.g.: -`https://$CI_BUILD_REF_SLUG.review.example.com`. We use `$CI_ENVIRONMENT_SLUG` +`https://$CI_BUILD_REF_SLUG.example.com`. We use `$CI_ENVIRONMENT_SLUG` here because it is guaranteed to be unique, but if you're using a workflow like [GitLab Flow][gitlab-flow], collisions are very unlikely, and you may prefer environment names to be more closely based on the branch name - the example -above would give you an URL like `https://100-do-the-thing.review.example.com` +above would give you an URL like `https://100-do-the-thing.example.com` Last but not least, we tell the job to run [`only`][only] on branches [`except`][only] master.