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

Merge branch 'bypass-slash-validation-check' into 'main'

Fix cache:key with slashes with a workaround

Closes #7

See merge request components/opentofu!33
parents e6a4a8bf c1e98604
No related merge requests found
......@@ -64,9 +64,12 @@ opentofu:use-component-instead-of-template:
#allow_failure: true
allow_failure: true
cache:
key: "$TF_ROOT"
key: "$__CACHE_KEY_HACK"
paths:
- $TF_ROOT/.terraform/
variables:
# FIXME: work around to make slashes work in `cache:key`. see https://gitlab.com/gitlab-org/gitlab/-/issues/439898
__CACHE_KEY_HACK: "$TF_ROOT"
image:
name: '$GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE/gitlab-opentofu:$GITLAB_OPENTOFU_VERSION-opentofu$OPENTOFU_VERSION'
script:
......@@ -80,9 +83,12 @@ opentofu:use-component-instead-of-template:
when: never
- if: $CI_COMMIT_BRANCH # If there's no open merge request, add it to a *branch* pipeline instead.
cache:
key: "$TF_ROOT"
key: "$__CACHE_KEY_HACK"
paths:
- $TF_ROOT/.terraform/
variables:
# FIXME: work around to make slashes work in `cache:key`. see https://gitlab.com/gitlab-org/gitlab/-/issues/439898
__CACHE_KEY_HACK: "$TF_ROOT"
image:
name: '$GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE/gitlab-opentofu:$GITLAB_OPENTOFU_VERSION-opentofu$OPENTOFU_VERSION'
script:
......@@ -112,9 +118,12 @@ opentofu:use-component-instead-of-template:
when: never
- if: $CI_COMMIT_BRANCH # If there's no open merge request, add it to a *branch* pipeline instead.
cache:
key: "$TF_ROOT"
key: "$__CACHE_KEY_HACK"
paths:
- $TF_ROOT/.terraform/
variables:
# FIXME: work around to make slashes work in `cache:key`. see https://gitlab.com/gitlab-org/gitlab/-/issues/439898
__CACHE_KEY_HACK: "$TF_ROOT"
image:
name: '$GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE/gitlab-opentofu:$GITLAB_OPENTOFU_VERSION-opentofu$OPENTOFU_VERSION'
script:
......@@ -132,9 +141,12 @@ opentofu:use-component-instead-of-template:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
cache:
key: "$TF_ROOT"
key: "$__CACHE_KEY_HACK"
paths:
- $TF_ROOT/.terraform/
variables:
# FIXME: work around to make slashes work in `cache:key`. see https://gitlab.com/gitlab-org/gitlab/-/issues/439898
__CACHE_KEY_HACK: "$TF_ROOT"
image:
name: '$GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE/gitlab-opentofu:$GITLAB_OPENTOFU_VERSION-opentofu$OPENTOFU_VERSION'
script:
......@@ -150,9 +162,12 @@ opentofu:use-component-instead-of-template:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && "$_TF_AUTO_DESTROY" == "true"'
- when: manual
cache:
key: "$TF_ROOT"
key: "$__CACHE_KEY_HACK"
paths:
- $TF_ROOT/.terraform/
variables:
# FIXME: work around to make slashes work in `cache:key`. see https://gitlab.com/gitlab-org/gitlab/-/issues/439898
__CACHE_KEY_HACK: "$TF_ROOT"
image:
name: '$GITLAB_OPENTOFU_IMAGE_REGISTRY_BASE/gitlab-opentofu:$GITLAB_OPENTOFU_VERSION-opentofu$OPENTOFU_VERSION'
script:
......
......@@ -59,10 +59,12 @@ spec:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
cache:
key: "$[[ inputs.root_dir ]]"
key: "$__CACHE_KEY_HACK"
paths:
- $[[ inputs.root_dir ]]/.terraform/
variables:
# FIXME: work around to make slashes work in `cache:key`. see https://gitlab.com/gitlab-org/gitlab/-/issues/439898
__CACHE_KEY_HACK: "$[[ inputs.root_dir ]]"
TF_ROOT: $[[ inputs.root_dir ]]
TF_STATE_NAME: $[[ inputs.state_name ]]
image:
......
......@@ -58,10 +58,12 @@ spec:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && "$[[ inputs.auto_destroy ]]" == "true"'
- when: manual
cache:
key: "$[[ inputs.root_dir ]]"
key: "$__CACHE_KEY_HACK"
paths:
- $[[ inputs.root_dir ]]/.terraform/
variables:
# FIXME: work around to make slashes work in `cache:key`. see https://gitlab.com/gitlab-org/gitlab/-/issues/439898
__CACHE_KEY_HACK: "$[[ inputs.root_dir ]]"
TF_ROOT: $[[ inputs.root_dir ]]
TF_STATE_NAME: $[[ inputs.state_name ]]
image:
......
......@@ -59,10 +59,12 @@ spec:
#allow_failure: $[[ inputs.allow_failure ]]
allow_failure: true
cache:
key: "$[[ inputs.root_dir ]]"
key: "$__CACHE_KEY_HACK"
paths:
- $[[ inputs.root_dir ]]/.terraform/
variables:
# FIXME: work around to make slashes work in `cache:key`. see https://gitlab.com/gitlab-org/gitlab/-/issues/439898
__CACHE_KEY_HACK: "$[[ inputs.root_dir ]]"
TF_ROOT: $[[ inputs.root_dir ]]
image:
name: '$[[ inputs.image_registry_base ]]/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]'
......
......@@ -69,10 +69,12 @@ spec:
when: never
- if: $CI_COMMIT_BRANCH # If there's no open merge request, add it to a *branch* pipeline instead.
cache:
key: "$[[ inputs.root_dir ]]"
key: "$__CACHE_KEY_HACK"
paths:
- $[[ inputs.root_dir ]]/.terraform/
variables:
# FIXME: work around to make slashes work in `cache:key`. see https://gitlab.com/gitlab-org/gitlab/-/issues/439898
__CACHE_KEY_HACK: "$[[ inputs.root_dir ]]"
TF_ROOT: $[[ inputs.root_dir ]]
TF_STATE_NAME: $[[ inputs.state_name ]]
image:
......
......@@ -53,10 +53,12 @@ spec:
when: never
- if: $CI_COMMIT_BRANCH # If there's no open merge request, add it to a *branch* pipeline instead.
cache:
key: "$[[ inputs.root_dir ]]"
key: "$__CACHE_KEY_HACK"
paths:
- $[[ inputs.root_dir ]]/.terraform/
variables:
# FIXME: work around to make slashes work in `cache:key`. see https://gitlab.com/gitlab-org/gitlab/-/issues/439898
__CACHE_KEY_HACK: "$[[ inputs.root_dir ]]"
TF_ROOT: $[[ inputs.root_dir ]]
TF_STATE_NAME: $[[ inputs.state_name ]]
image:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment