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
62c9f1ab
Commit
62c9f1ab
authored
Jul 16, 2020
by
Matt Kasa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix non-working variable refs in infrastructure doc
parent
e57b5ef5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
doc/user/infrastructure/index.md
doc/user/infrastructure/index.md
+10
-8
No files found.
doc/user/infrastructure/index.md
View file @
62c9f1ab
...
@@ -117,15 +117,18 @@ and the CI YAML file:
...
@@ -117,15 +117,18 @@ and the CI YAML file:
```
```
1.
In the
`.gitlab-ci.yaml`
file, define some environment variables to ease
1.
In the
`.gitlab-ci.yaml`
file, define some environment variables to ease
development. In this example,
`TF_STATE`
is the name of the Terraform state
development. In this example,
`TF_ROOT`
is the directory where the Terraform
(projects may have multiple states),
`TF_ADDRESS`
is the URL to the state on
commands must be executed,
`TF_ADDRESS`
is the URL to the state on the GitLab
the GitLab instance where this pipeline runs, and
`TF_ROOT`
is the directory
instance where this pipeline runs, and the final path segment in
`TF_ADDRESS`
where the Terraform commands must be executed:
is the name of the Terraform state. Projects may have multiple states, and
this name is arbitrary, so in this example we will set it to the name of the
project, and we will ensure that the
`.terraform`
directory is cached between
jobs in the pipeline using a cache key based on the state name:
```
yaml
```
yaml
variables
:
variables
:
TF_ADDRESS
:
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${CI_PROJECT_NAME}
TF_ROOT
:
${CI_PROJECT_DIR}/environments/cloudflare/production
TF_ROOT
:
${CI_PROJECT_DIR}/environments/cloudflare/production
TF_ADDRESS
:
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${CI_PROJECT_NAME}
cache
:
cache
:
key
:
${CI_PROJECT_NAME}
key
:
${CI_PROJECT_NAME}
...
@@ -272,12 +275,11 @@ can configure this manually as follows:
...
@@ -272,12 +275,11 @@ can configure this manually as follows:
image
:
registry.gitlab.com/gitlab-org/terraform-images/stable:latest
image
:
registry.gitlab.com/gitlab-org/terraform-images/stable:latest
variables
:
variables
:
TF_STATE
:
${CI_PROJECT_NAME}
TF_ADDRESS
:
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${TF_STATE}
TF_ROOT
:
${CI_PROJECT_DIR}/environments/cloudflare/production
TF_ROOT
:
${CI_PROJECT_DIR}/environments/cloudflare/production
TF_ADDRESS
:
${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/terraform/state/${CI_PROJECT_NAME}
cache
:
cache
:
key
:
${
TF_STAT
E}
key
:
${
CI_PROJECT_NAM
E}
paths
:
paths
:
-
${TF_ROOT}/.terraform
-
${TF_ROOT}/.terraform
...
...
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