Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenTofu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
components
OpenTofu
Commits
34763746
Unverified
Commit
34763746
authored
1 year ago
by
Timo Furrer
Browse files
Options
Downloads
Patches
Plain Diff
Improve README
parent
b7223dea
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab/README.md.template
+33
-5
33 additions, 5 deletions
.gitlab/README.md.template
README.md
+33
-5
33 additions, 5 deletions
README.md
with
66 additions
and
10 deletions
.gitlab/README.md.template
+
33
−
5
View file @
34763746
# OpenTofu CI/CD Component
# OpenTofu CI/CD Component
>
🚨
🚧 **NOTE** 🚧
🚨
> 🚧 **NOTE** 🚧
>
>
> This component is **work in progress**, where inputs, template names and the entire interface in general may
> change at any time until version 1.0.0 is reached. From where on this CI/CD component will be versioned using [semver 2.0](https://semver.org/).
> The progress of implementing such a version can be tracked in https://gitlab.com/groups/gitlab-org/-/epics/12401.
>
> The `src/gitlab-tofu.sh` script is still merely a copy from [`gitlab-terraform`](https://gitlab.com/gitlab-org/terraform-images).
> The `src/gitlab-tofu.sh` script is still merely a copy from [`gitlab-terraform`](https://gitlab.com/gitlab-org/terraform-images).
> Therefore, lots of things in this script and in the templates are still Terraform-related and haven't
> Therefore, lots of things in this script and in the templates are still Terraform-related and haven't
> been changed to their OpenTofu equivalents.
> been changed to their OpenTofu equivalents.
> Have a look at the [Migrating from the Terraform CI/CD templates](#migrating-from-the-terraform-cicd-templates)
section when migrating from Terraform CI/CD templates.
This project is home to the **OpenTofu CI/CD component** and it's related assets,
This project is home to the **OpenTofu CI/CD component** and it's related assets,
like the `gitlab-tofu` wrapper script and OCI images containing that script
like the `gitlab-tofu` wrapper script and OCI images containing that script
...
@@ -40,6 +38,20 @@ include:
...
@@ -40,6 +38,20 @@ include:
opentofu_version: <OPENTOFU_VERSION>
opentofu_version: <OPENTOFU_VERSION>
stages: [validate, build, deploy, cleanup]
stages: [validate, build, deploy, cleanup]
---
# ... or without the destroy jobs:
include:
- component: gitlab.com/components/opentofu/validate-plan-apply@<VERSION>
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
# once https://gitlab.com/gitlab-org/gitlab/-/issues/438275 is solved.
version: <VERSION>
opentofu_version: <OPENTOFU_VERSION>
stages: [validate, build, deploy]
```
```
A concrete example may look like this:
A concrete example may look like this:
...
@@ -162,6 +174,14 @@ Have a look at the individual template spec to learn about the available inputs.
...
@@ -162,6 +174,14 @@ Have a look at the individual template spec to learn about the available inputs.
| ---- | ------- | ----------- |
| ---- | ------- | ----------- |
<INPUTS>
<INPUTS>
### Variables
(🚧 *This section is work in progress*)
Have a look at the [`src/gitlab-tofu.sh`](src/gitlab-tofu.sh) script and how the `TF_`-prefixed
variables are being used. You may set them according to your needs.
## Releases & Versioning
## Releases & Versioning
This project currently releases tagged commits.
This project currently releases tagged commits.
...
@@ -235,10 +255,18 @@ When migrating from the GitLab Terraform CI/CD templates you can use the followi
...
@@ -235,10 +255,18 @@ When migrating from the GitLab Terraform CI/CD templates you can use the followi
- Migrate the `TF_STATE_NAME` variable to the `state_name` input.
- Migrate the `TF_STATE_NAME` variable to the `state_name` input.
- Although the `TF_STATE_NAME` variable is still used and maybe overwritten after the import on individual jobs.
- Although the `TF_STATE_NAME` variable is still used and maybe overwritten after the import on individual jobs.
- Migrate the `TF_AUTO_DEPLOY` variable to the `auto_apply` input.
- Migrate the `TF_AUTO_DEPLOY` variable to the `auto_apply` input.
- Used other variables -> Use the same variables with this component.
The same rules apply for the `latest` templates.
The same rules apply for the `latest` templates.
We also recommend to check out the [Usage](#Usage) section for more details about the available templates and inputs.
We also recommend to check out the [Usage](#Usage) section for more details about the available templates and inputs.
### OpenTofu component `inputs` vs. Terraform template `variables`
This OpenTofu CI/CD component makes use of [`inputs`](https://docs.gitlab.com/ee/ci/yaml/#specinputs)
whereas the Terraform CI/CD templates used [`variables`](https://docs.gitlab.com/ee/ci/yaml/#variables).
We recommend that you use the `inputs` with the OpenTofu component where available and required.
However, if needed you may overwrite the jobs and set the `variables` you like.
## Contributing
## Contributing
See the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
See the [CONTRIBUTING.md](CONTRIBUTING.md) guide.
This diff is collapsed.
Click to expand it.
README.md
+
33
−
5
View file @
34763746
...
@@ -2,15 +2,13 @@
...
@@ -2,15 +2,13 @@
# OpenTofu CI/CD Component
# OpenTofu CI/CD Component
>
🚨
🚧 **NOTE** 🚧
🚨
> 🚧 **NOTE** 🚧
>
>
> This component is **work in progress**, where inputs, template names and the entire interface in general may
> change at any time until version 1.0.0 is reached. From where on this CI/CD component will be versioned using [semver 2.0](https://semver.org/).
> The progress of implementing such a version can be tracked in https://gitlab.com/groups/gitlab-org/-/epics/12401.
>
> The `src/gitlab-tofu.sh` script is still merely a copy from [`gitlab-terraform`](https://gitlab.com/gitlab-org/terraform-images).
> The `src/gitlab-tofu.sh` script is still merely a copy from [`gitlab-terraform`](https://gitlab.com/gitlab-org/terraform-images).
> Therefore, lots of things in this script and in the templates are still Terraform-related and haven't
> Therefore, lots of things in this script and in the templates are still Terraform-related and haven't
> been changed to their OpenTofu equivalents.
> been changed to their OpenTofu equivalents.
> Have a look at the [Migrating from the Terraform CI/CD templates](#migrating-from-the-terraform-cicd-templates)
section when migrating from Terraform CI/CD templates.
This project is home to the
**OpenTofu CI/CD component**
and it's related assets,
This project is home to the
**OpenTofu CI/CD component**
and it's related assets,
like the
`gitlab-tofu`
wrapper script and OCI images containing that script
like the
`gitlab-tofu`
wrapper script and OCI images containing that script
...
@@ -42,6 +40,20 @@ include:
...
@@ -42,6 +40,20 @@ include:
opentofu_version
:
<OPENTOFU_VERSION>
opentofu_version
:
<OPENTOFU_VERSION>
stages
:
[
validate
,
build
,
deploy
,
cleanup
]
stages
:
[
validate
,
build
,
deploy
,
cleanup
]
---
# ... or without the destroy jobs:
include
:
-
component
:
gitlab.com/components/opentofu/validate-plan-apply@<VERSION>
inputs
:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
# once https://gitlab.com/gitlab-org/gitlab/-/issues/438275 is solved.
version
:
<VERSION>
opentofu_version
:
<OPENTOFU_VERSION>
stages
:
[
validate
,
build
,
deploy
]
```
```
A concrete example may look like this:
A concrete example may look like this:
...
@@ -181,6 +193,14 @@ The following OpenTofu versions are available with this component via the `opent
...
@@ -181,6 +193,14 @@ The following OpenTofu versions are available with this component via the `opent
-
[
`1.6.0`
](
https://github.com/opentofu/opentofu/releases/tag/v1.6.0
)
-
[
`1.6.0`
](
https://github.com/opentofu/opentofu/releases/tag/v1.6.0
)
-
[
`1.6.0-rc1`
](
https://github.com/opentofu/opentofu/releases/tag/v1.6.0-rc1
)
-
[
`1.6.0-rc1`
](
https://github.com/opentofu/opentofu/releases/tag/v1.6.0-rc1
)
### Variables
(🚧
*This section is work in progress*
)
Have a look at the
[
`src/gitlab-tofu.sh`
](
src/gitlab-tofu.sh
)
script and how the
`TF_`
-prefixed
variables are being used. You may set them according to your needs.
## Releases & Versioning
## Releases & Versioning
This project currently releases tagged commits.
This project currently releases tagged commits.
...
@@ -254,10 +274,18 @@ When migrating from the GitLab Terraform CI/CD templates you can use the followi
...
@@ -254,10 +274,18 @@ When migrating from the GitLab Terraform CI/CD templates you can use the followi
-
Migrate the
`TF_STATE_NAME`
variable to the
`state_name`
input.
-
Migrate the
`TF_STATE_NAME`
variable to the
`state_name`
input.
-
Although the
`TF_STATE_NAME`
variable is still used and maybe overwritten after the import on individual jobs.
-
Although the
`TF_STATE_NAME`
variable is still used and maybe overwritten after the import on individual jobs.
-
Migrate the
`TF_AUTO_DEPLOY`
variable to the
`auto_apply`
input.
-
Migrate the
`TF_AUTO_DEPLOY`
variable to the
`auto_apply`
input.
-
Used other variables -> Use the same variables with this component.
The same rules apply for the
`latest`
templates.
The same rules apply for the
`latest`
templates.
We also recommend to check out the
[
Usage
](
#Usage
)
section for more details about the available templates and inputs.
We also recommend to check out the
[
Usage
](
#Usage
)
section for more details about the available templates and inputs.
### OpenTofu component `inputs` vs. Terraform template `variables`
This OpenTofu CI/CD component makes use of
[
`inputs`
](
https://docs.gitlab.com/ee/ci/yaml/#specinputs
)
whereas the Terraform CI/CD templates used
[
`variables`
](
https://docs.gitlab.com/ee/ci/yaml/#variables
)
.
We recommend that you use the
`inputs`
with the OpenTofu component where available and required.
However, if needed you may overwrite the jobs and set the
`variables`
you like.
## Contributing
## Contributing
See the
[
CONTRIBUTING.md
](
CONTRIBUTING.md
)
guide.
See the
[
CONTRIBUTING.md
](
CONTRIBUTING.md
)
guide.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment