Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c742011d
Commit
c742011d
authored
Sep 10, 2021
by
feistel
Committed by
Marcel Amirault
Sep 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: document to use CI_COMMIT_REF_SLUG instead of CI_COMMIT_REF_NAME for review apps
parent
24875d7d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
20 deletions
+20
-20
doc/ci/environments/index.md
doc/ci/environments/index.md
+13
-13
doc/ci/review_apps/index.md
doc/ci/review_apps/index.md
+1
-1
doc/ci/yaml/index.md
doc/ci/yaml/index.md
+5
-5
doc/user/project/merge_requests/load_performance_testing.md
doc/user/project/merge_requests/load_performance_testing.md
+1
-1
No files found.
doc/ci/environments/index.md
View file @
c742011d
...
...
@@ -99,7 +99,7 @@ deploy_review:
script
:
-
echo "Deploy a review app"
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
url
:
https://$CI_ENVIRONMENT_SLUG.example.com
rules
:
-
if
:
$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
...
...
@@ -109,9 +109,9 @@ deploy_review:
In this example:
-
The
`name`
is
`review/$CI_COMMIT_REF_
NAME
`
. Because the
[
environment name
](
../yaml/index.md#environmentname
)
-
The
`name`
is
`review/$CI_COMMIT_REF_
SLUG
`
. Because the
[
environment name
](
../yaml/index.md#environmentname
)
can contain slashes (
`/`
), you can use this pattern to distinguish between dynamic and static environments.
-
For the
`url`
, you could use
`$CI_COMMIT_REF_
NAME
`
, but because this value
-
For the
`url`
, you could use
`$CI_COMMIT_REF_
SLUG
`
, but because this value
may contain a
`/`
or other characters that would not be valid in a domain name or URL,
use
`$CI_ENVIRONMENT_SLUG`
instead. The
`$CI_ENVIRONMENT_SLUG`
variable is guaranteed to be unique.
...
...
@@ -385,7 +385,7 @@ deploy_review:
script
:
-
echo "Deploy a review app"
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
url
:
https://$CI_ENVIRONMENT_SLUG.example.com
on_stop
:
stop_review
rules
:
...
...
@@ -396,7 +396,7 @@ stop_review:
script
:
-
echo "Remove review app"
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
action
:
stop
rules
:
-
if
:
$CI_MERGE_REQUEST_ID
...
...
@@ -440,7 +440,7 @@ is created or updated. The environment runs until `stop_review_app` is executed:
review_app
:
script
:
deploy-review-app
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
on_stop
:
stop_review_app
auto_stop_in
:
1 week
rules
:
...
...
@@ -449,7 +449,7 @@ review_app:
stop_review_app
:
script
:
stop-review-app
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
action
:
stop
rules
:
-
if
:
$CI_MERGE_REQUEST_ID
...
...
@@ -538,7 +538,7 @@ then in the UI, the environments are grouped under that heading:
![
Environment groups
](
img/environments_dynamic_groups_v13_10.png
)
The following example shows how to start your environment names with
`review`
.
The
`$CI_COMMIT_REF_
NAME
`
variable is populated with the branch name at runtime:
The
`$CI_COMMIT_REF_
SLUG
`
variable is populated with the branch name at runtime:
```
yaml
deploy_review
:
...
...
@@ -546,7 +546,7 @@ deploy_review:
script
:
-
echo "Deploy a review app"
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
```
### Environment incident management
...
...
@@ -776,14 +776,14 @@ To ensure the `action: stop` can always run when needed, you can:
deploy_review
:
stage
:
deploy
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
url
:
https://$CI_ENVIRONMENT_SLUG.example.com
on_stop
:
stop_review
stop_review
:
stage
:
deploy
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
action
:
stop
when
:
manual
```
...
...
@@ -803,7 +803,7 @@ To ensure the `action: stop` can always run when needed, you can:
deploy_review
:
stage
:
deploy
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
url
:
https://$CI_ENVIRONMENT_SLUG.example.com
on_stop
:
stop_review
...
...
@@ -812,7 +812,7 @@ To ensure the `action: stop` can always run when needed, you can:
needs
:
-
deploy_review
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
action
:
stop
when
:
manual
```
doc/ci/review_apps/index.md
View file @
c742011d
...
...
@@ -57,7 +57,7 @@ The process of configuring Review Apps is as follows:
1.
Set up the infrastructure to host and deploy the Review Apps (check the
[
examples
](
#review-apps-examples
)
below).
1.
[
Install
](
https://docs.gitlab.com/runner/install/
)
and
[
configure
](
https://docs.gitlab.com/runner/commands/
)
a runner to do deployment.
1.
Set up a job in
`.gitlab-ci.yml`
that uses the
[
predefined CI/CD variable
](
../variables/index.md
)
`${CI_COMMIT_REF_
NAME
}`
1.
Set up a job in
`.gitlab-ci.yml`
that uses the
[
predefined CI/CD variable
](
../variables/index.md
)
`${CI_COMMIT_REF_
SLUG
}`
to create dynamic environments and restrict it to run only on branches.
Alternatively, you can get a YML template for this job by
[
enabling review apps
](
#enable-review-apps-button
)
for your project.
1.
Optionally, set a job that
[
manually stops
](
../environments/index.md#stop-an-environment
)
the Review Apps.
...
...
doc/ci/yaml/index.md
View file @
c742011d
...
...
@@ -2136,7 +2136,7 @@ review_app:
stage
:
deploy
script
:
make deploy-app
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
url
:
https://$CI_ENVIRONMENT_SLUG.example.com
on_stop
:
stop_review_app
...
...
@@ -2147,7 +2147,7 @@ stop_review_app:
script
:
make delete-app
when
:
manual
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
action
:
stop
```
...
...
@@ -2197,7 +2197,7 @@ For example,
review_app
:
script
:
deploy-review-app
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
auto_stop_in
:
1 day
```
...
...
@@ -2267,12 +2267,12 @@ deploy as review app:
stage
:
deploy
script
:
make deploy
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
url
:
https://$CI_ENVIRONMENT_SLUG.example.com/
```
The
`deploy as review app`
job is marked as a deployment to dynamically
create the
`review/$CI_COMMIT_REF_
NAME`
environment.
`$CI_COMMIT_REF_NAME
`
create the
`review/$CI_COMMIT_REF_
SLUG`
environment.
`$CI_COMMIT_REF_SLUG
`
is a
[
CI/CD variable
](
../variables/index.md
)
set by the runner. The
`$CI_ENVIRONMENT_SLUG`
variable is based on the environment name, but suitable
for inclusion in URLs. If the
`deploy as review app`
job runs in a branch named
...
...
doc/user/project/merge_requests/load_performance_testing.md
View file @
c742011d
...
...
@@ -181,7 +181,7 @@ include:
review
:
stage
:
deploy
environment
:
name
:
review/$CI_COMMIT_REF_
NAME
name
:
review/$CI_COMMIT_REF_
SLUG
url
:
http://$CI_ENVIRONMENT_SLUG.example.com
script
:
-
run_deploy_script
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment