Skip to content
Snippets Groups Projects
Commit 1b02a326 authored by Timo Furrer's avatar Timo Furrer
Browse files

Merge branch 'phahn' into 'main'

fix: get project values from CI variables

Closes #36

See merge request components/opentofu!56

Changelog: fixed
parents fdc0852b 8ddafb2c
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ include:
# Additionally, when this project is mirrored into another instance the component reference fails.
# This may be solved with https://gitlab.com/gitlab-org/gitlab/-/issues/434260#note_1776822074
# - component: gitlab.com/components/container-scanning/container-scanning@3.0
# - component: $CI_SERVER_FQDN/components/container-scanning/container-scanning@3.0
# inputs:
# stage: quality
# cs_image: $GITLAB_OPENTOFU_IMAGE_NAME
......
......@@ -29,7 +29,7 @@ You find all releases on the [Releases Overview Page](https://gitlab.com/compone
```yaml
include:
- component: gitlab.com/components/opentofu/full-pipeline@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/full-pipeline@<VERSION>
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -43,7 +43,7 @@ stages: [validate, test, build, deploy, cleanup]
# ... or without the destroy jobs:
include:
- component: gitlab.com/components/opentofu/validate-plan-apply@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/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
......@@ -59,7 +59,7 @@ A concrete example may look like this:
```yaml
# Using version `0.10.0`:
include:
- component: gitlab.com/components/opentofu/full-pipeline@0.10.0
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/full-pipeline@0.10.0
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -74,7 +74,7 @@ stages: [validate, test, build, deploy, cleanup]
# ... in case you absolutely know what you are doing and are
# aware that this may introduce breaking changes, you may use the latest release:
include:
- component: gitlab.com/components/opentofu/full-pipeline@~latest
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/full-pipeline@~latest
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -89,7 +89,7 @@ Or import all jobs as hidden templates ready to be extended:
```yaml
include:
- component: gitlab.com/components/opentofu/job-templates@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/job-templates@<VERSION>
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -122,7 +122,7 @@ and compose your own pipeline, for example, to just run the `fmt` job you can do
```yaml
include:
- component: gitlab.com/components/opentofu/fmt@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/fmt@<VERSION>
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -139,7 +139,7 @@ you want to extend the jobs:
```yaml
include:
- component: gitlab.com/components/opentofu/job-templates@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/job-templates@<VERSION>
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -195,7 +195,7 @@ the tools. For example to install `jq`:
```yaml
include:
- component: gitlab.com/components/opentofu/validate-plan@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/validate-plan@<VERSION>
inputs:
version: <VERSION>
opentofu_version: 1.6.1
......@@ -227,10 +227,10 @@ and as the `version` input. Check out the [Usage](#Usage) section for examples.
Each component release deploys the following images:
- `registry.gitlab.com/components/opentofu/gitlab-opentofu:<VERSION>-opentofu<OPENTOFU_VERSION>`
- `registry.gitlab.com/components/opentofu/gitlab-opentofu:<VERSION>-opentofu`
- `$CI_REGISTRY/$CI_PROJECT_PATH/gitlab-opentofu:<VERSION>-opentofu<OPENTOFU_VERSION>`
- `$CI_REGISTRY/$CI_PROJECT_PATH/gitlab-opentofu:<VERSION>-opentofu`
- Includes the latest stable OpenTofu version at the time of releasing the component
- `registry.gitlab.com/components/opentofu/gitlab-opentofu:<VERSION>`
- `$CI_REGISTRY/$CI_PROJECT_PATH/gitlab-opentofu:<VERSION>`
- Includes the latest stable OpenTofu version at the time of releasing the component
In the above examples `<VERSION>` references the component version and `<OPENTOFU_VERSION>`
......@@ -255,7 +255,7 @@ and then use the component as you would from GitLab.com, but change the domain,
```yaml
include:
- component: gitlab.example.com/components/opentofu/full-pipeline@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/full-pipeline@<VERSION>
inputs:
...
```
......
......@@ -8,7 +8,7 @@ You can use the OpenTofu CI/CD component from the CI/CD catalog using:
```yaml
include:
- component: gitlab.com/components/opentofu/full-pipeline@$CI_COMMIT_TAG
- component: $CI_COMMIT_TAG/$CI_PROJECT_PATH/full-pipeline@$CI_COMMIT_TAG
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......
......@@ -31,7 +31,7 @@ You find all releases on the [Releases Overview Page](https://gitlab.com/compone
```yaml
include:
- component: gitlab.com/components/opentofu/full-pipeline@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/full-pipeline@<VERSION>
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -45,7 +45,7 @@ stages: [validate, test, build, deploy, cleanup]
# ... or without the destroy jobs:
include:
- component: gitlab.com/components/opentofu/validate-plan-apply@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/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
......@@ -61,7 +61,7 @@ A concrete example may look like this:
```yaml
# Using version `0.10.0`:
include:
- component: gitlab.com/components/opentofu/full-pipeline@0.10.0
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/full-pipeline@0.10.0
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -76,7 +76,7 @@ stages: [validate, test, build, deploy, cleanup]
# ... in case you absolutely know what you are doing and are
# aware that this may introduce breaking changes, you may use the latest release:
include:
- component: gitlab.com/components/opentofu/full-pipeline@~latest
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/full-pipeline@~latest
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -91,7 +91,7 @@ Or import all jobs as hidden templates ready to be extended:
```yaml
include:
- component: gitlab.com/components/opentofu/job-templates@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/job-templates@<VERSION>
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -124,7 +124,7 @@ and compose your own pipeline, for example, to just run the `fmt` job you can do
```yaml
include:
- component: gitlab.com/components/opentofu/fmt@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/fmt@<VERSION>
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -141,7 +141,7 @@ you want to extend the jobs:
```yaml
include:
- component: gitlab.com/components/opentofu/job-templates@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/job-templates@<VERSION>
inputs:
# The version must currently be specified explicitly as an input,
# to find the correctly associated images. # This can be removed
......@@ -218,7 +218,7 @@ the tools. For example to install `jq`:
```yaml
include:
- component: gitlab.com/components/opentofu/validate-plan@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/validate-plan@<VERSION>
inputs:
version: <VERSION>
opentofu_version: 1.6.1
......@@ -250,10 +250,10 @@ and as the `version` input. Check out the [Usage](#Usage) section for examples.
Each component release deploys the following images:
- `registry.gitlab.com/components/opentofu/gitlab-opentofu:<VERSION>-opentofu<OPENTOFU_VERSION>`
- `registry.gitlab.com/components/opentofu/gitlab-opentofu:<VERSION>-opentofu`
- `$CI_REGISTRY/$CI_PROJECT_PATH/gitlab-opentofu:<VERSION>-opentofu<OPENTOFU_VERSION>`
- `$CI_REGISTRY/$CI_PROJECT_PATH/gitlab-opentofu:<VERSION>-opentofu`
- Includes the latest stable OpenTofu version at the time of releasing the component
- `registry.gitlab.com/components/opentofu/gitlab-opentofu:<VERSION>`
- `$CI_REGISTRY/$CI_PROJECT_PATH/gitlab-opentofu:<VERSION>`
- Includes the latest stable OpenTofu version at the time of releasing the component
In the above examples `<VERSION>` references the component version and `<OPENTOFU_VERSION>`
......@@ -278,7 +278,7 @@ and then use the component as you would from GitLab.com, but change the domain,
```yaml
include:
- component: gitlab.example.com/components/opentofu/full-pipeline@<VERSION>
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/full-pipeline@<VERSION>
inputs:
...
```
......
......@@ -19,7 +19,7 @@ variables:
# Compatible OpenTofu version, see https://gitlab.com/components/opentofu/-/releases
OPENTOFU_VERSION: "1.6.0"
# Job Image with `gitlab-tofu`
GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE: $CI_REGISTRY/components/opentofu
GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE: $CI_REGISTRY/$CI_PROJECT_PATH
# The relative path to the root directory of the OpenTofu project
TF_ROOT: ${CI_PROJECT_DIR}
# The name of the state file used by the GitLab Managed Terraform state backend
......@@ -42,7 +42,7 @@ opentofu:use-component-instead-of-template:
echo "To include the CI/CD component with a default configuration:"
echo " "
echo "include:"
echo " - component: gitlab.com/components/opentofu/full-pipeline@<VERSION>"
echo " - component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/full-pipeline@<VERSION>"
echo " inputs:"
echo " version: <VERSION>"
echo " opentofu_version: 1.6.0"
......
......@@ -19,7 +19,7 @@ variables:
# Compatible OpenTofu version, see https://gitlab.com/components/opentofu/-/releases
OPENTOFU_VERSION: "1.6.0"
# Job Image with `gitlab-tofu`
GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE: $CI_REGISTRY/components/opentofu
GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE: $CI_REGISTRY/$CI_PROJECT_PATH
# The relative path to the root directory of the OpenTofu project
TF_ROOT: ${CI_PROJECT_DIR}
# The name of the state file used by the GitLab Managed Terraform state backend
......@@ -42,7 +42,7 @@ opentofu:use-component-instead-of-template:
echo "To include the CI/CD component with a default configuration:"
echo " "
echo "include:"
echo " - component: gitlab.com/components/opentofu/full-pipeline@<VERSION>"
echo " - component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/full-pipeline@<VERSION>"
echo " inputs:"
echo " version: <VERSION>"
echo " opentofu_version: 1.6.0"
......
include:
- component: gitlab.com/$CI_PROJECT_PATH/full-pipeline@$CI_COMMIT_SHA
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/full-pipeline@$CI_COMMIT_SHA
inputs:
image_registry_base: $GITLAB_OPENTOFU_IMAGE_BASE
version: $CI_COMMIT_SHA
......
include:
- component: gitlab.com/$CI_PROJECT_PATH/job-templates@$CI_COMMIT_SHA
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/job-templates@$CI_COMMIT_SHA
inputs:
image_registry_base: $GITLAB_OPENTOFU_IMAGE_BASE
version: $CI_COMMIT_SHA
......
include:
- component: gitlab.com/$CI_PROJECT_PATH/test@$CI_COMMIT_SHA
- component: $CI_SERVER_FQDN/$CI_PROJECT_PATH/test@$CI_COMMIT_SHA
inputs:
image_registry_base: $GITLAB_OPENTOFU_IMAGE_BASE
version: $CI_COMMIT_SHA
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment