Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • auto-apply-for-backports
  • deploy-refactor
  • destroy-pipeline
  • destroy-plan
  • fix-readme-path
  • main
  • no-rules-in-job-templates
  • subdir
  • 0.0.0-alpha1
  • 0.1.0
  • 0.1.0-alpha1
  • 0.1.0-alpha10
  • 0.1.0-alpha11
  • 0.1.0-alpha12
  • 0.1.0-alpha2
  • 0.1.0-alpha3
  • 0.1.0-alpha4
  • 0.1.0-alpha5
  • 0.1.0-alpha6
  • 0.1.0-alpha7
  • 0.1.0-alpha8
  • 0.1.0-alpha9
  • 0.10.0
  • 0.10.0-rc1
  • 0.10.0-rc2
  • 0.11.0
  • 0.11.0-rc1
  • 0.12.0
  • 0.13.0
  • 0.14.0
  • 0.15.0
  • 0.16.0
  • 0.17.0
  • 0.18.0
  • 0.18.0-rc1
  • 0.18.0-rc2
  • 0.18.0-rc3
  • 0.18.0-rc4
  • 0.18.0-rc5
  • 0.19.0
  • 0.19.0-rc1
  • 0.2.0
  • 0.20.0
  • 0.21.0
  • 0.22.0
  • 0.22.0-rc1
  • 0.22.0-rc2
  • 0.22.0-rc3
  • 0.22.0-rc4
  • 0.23.0
  • 0.24.0
  • 0.24.0-rc1
  • 0.25.0
  • 0.26.0
  • 0.27.0
  • 0.28.0
  • 0.29.0
  • 0.3.0
  • 0.3.0-alpha1
  • 0.3.0-alpha10
  • 0.3.0-alpha2
  • 0.3.0-alpha3
  • 0.3.0-alpha4
  • 0.3.0-alpha5
  • 0.3.0-alpha6
  • 0.3.0-alpha7
  • 0.3.0-alpha8
  • 0.3.0-alpha9
  • 0.30.0
  • 0.31.0
  • 0.32.0
  • 0.33.0
  • 0.34.0
  • 0.34.0-rc1
  • 0.35.0
  • 0.35.0-rc1
  • 0.35.0-rc2
  • 0.35.0-rc3
  • 0.35.0-rc4
  • 0.35.0-rc5
  • 0.35.0-rc6
  • 0.36.0
  • 0.37.0
  • 0.37.0-rc2
  • 0.37.0-rc3
  • 0.37.0-rc4
  • 0.37.0-rc5
  • 0.37.0-rc6
  • 0.37.0-rc7
  • 0.38.0
  • 0.39.0
  • 0.39.0-rc1
  • 0.39.0-rc2
  • 0.4.0
  • 0.4.0-alpha1
  • 0.40.0
  • 0.40.0-rc1
  • 0.40.0-rc2
  • 0.40.0-rc3
  • 0.40.0-rc4
  • 0.40.0-rc5
  • 0.40.0-rc6
  • 0.40.0-rc7
  • 0.41.0
  • 0.42.0
  • 0.42.0-rc1
  • 0.42.0-rc2
  • 0.42.0-rc3
108 results

Target

Select target project
  • components/opentofu
1 result
Select Git revision
  • auto-apply-for-backports
  • deploy-refactor
  • destroy-pipeline
  • destroy-plan
  • fix-readme-path
  • main
  • no-rules-in-job-templates
  • subdir
  • 0.0.0-alpha1
  • 0.1.0
  • 0.1.0-alpha1
  • 0.1.0-alpha10
  • 0.1.0-alpha11
  • 0.1.0-alpha12
  • 0.1.0-alpha2
  • 0.1.0-alpha3
  • 0.1.0-alpha4
  • 0.1.0-alpha5
  • 0.1.0-alpha6
  • 0.1.0-alpha7
  • 0.1.0-alpha8
  • 0.1.0-alpha9
  • 0.10.0
  • 0.10.0-rc1
  • 0.10.0-rc2
  • 0.11.0
  • 0.11.0-rc1
  • 0.12.0
  • 0.13.0
  • 0.14.0
  • 0.15.0
  • 0.16.0
  • 0.17.0
  • 0.18.0
  • 0.18.0-rc1
  • 0.18.0-rc2
  • 0.18.0-rc3
  • 0.18.0-rc4
  • 0.18.0-rc5
  • 0.19.0
  • 0.19.0-rc1
  • 0.2.0
  • 0.20.0
  • 0.21.0
  • 0.22.0
  • 0.22.0-rc1
  • 0.22.0-rc2
  • 0.22.0-rc3
  • 0.22.0-rc4
  • 0.23.0
  • 0.24.0
  • 0.24.0-rc1
  • 0.25.0
  • 0.26.0
  • 0.27.0
  • 0.28.0
  • 0.29.0
  • 0.3.0
  • 0.3.0-alpha1
  • 0.3.0-alpha10
  • 0.3.0-alpha2
  • 0.3.0-alpha3
  • 0.3.0-alpha4
  • 0.3.0-alpha5
  • 0.3.0-alpha6
  • 0.3.0-alpha7
  • 0.3.0-alpha8
  • 0.3.0-alpha9
  • 0.30.0
  • 0.31.0
  • 0.32.0
  • 0.33.0
  • 0.34.0
  • 0.34.0-rc1
  • 0.35.0
  • 0.35.0-rc1
  • 0.35.0-rc2
  • 0.35.0-rc3
  • 0.35.0-rc4
  • 0.35.0-rc5
  • 0.35.0-rc6
  • 0.36.0
  • 0.37.0
  • 0.37.0-rc2
  • 0.37.0-rc3
  • 0.37.0-rc4
  • 0.37.0-rc5
  • 0.37.0-rc6
  • 0.37.0-rc7
  • 0.38.0
  • 0.39.0
  • 0.39.0-rc1
  • 0.39.0-rc2
  • 0.4.0
  • 0.4.0-alpha1
  • 0.40.0
  • 0.40.0-rc1
  • 0.40.0-rc2
  • 0.40.0-rc3
  • 0.40.0-rc4
  • 0.40.0-rc5
  • 0.40.0-rc6
  • 0.40.0-rc7
  • 0.41.0
  • 0.42.0
  • 0.42.0-rc1
  • 0.42.0-rc2
  • 0.42.0-rc3
108 results
Show changes
Commits on Source (2)
......@@ -25,6 +25,7 @@ RUN apk add --no-cache \
# see https://opentofu.org/docs/intro/install/standalone
# We may want to switch to installing manually from GitHub and verifying signature
ARG OPENTOFU_VERSION
ENV OPENTOFU_VERSION=${OPENTOFU_VERSION}
RUN curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh && \
chmod +x install-opentofu.sh && \
./install-opentofu.sh --install-method standalone --opentofu-version "${OPENTOFU_VERSION}" && \
......
......@@ -40,6 +40,7 @@ RUN wget https://gitlab.com/gitlab-org/cli/-/releases/v${GLAB_VERSION}/downloads
# see https://opentofu.org/docs/intro/install/standalone
# We may want to switch to installing manually from GitHub and verifying signature
ARG OPENTOFU_VERSION
ENV OPENTOFU_VERSION=${OPENTOFU_VERSION}
RUN curl --proto '=https' --tlsv1.2 -fsSL https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh && \
chmod +x install-opentofu.sh && \
./install-opentofu.sh --install-method standalone --opentofu-version "${OPENTOFU_VERSION}" && \
......
......@@ -231,6 +231,11 @@ fi
# Helper functions
# ================
# is_tofu_at_least checks if OPENTOFU_VERSION is at least the one provided
is_tofu_at_least() {
test "$(printf "%s\n$1" "$OPENTOFU_VERSION" | sort -V | head -1)" = "$1"
}
# define_http_backend defines the HTTP backend in a file called __gitlab-opentofu-backend.tf if no backend can be found.
# The backend configuration is attempted to be found with a simple grep.
define_http_backend() {
......@@ -430,6 +435,11 @@ if [ $sourced -eq 0 ]; then
;;
"validate")
$should_do_implicit_init && tofu_init -backend=false
if ! is_tofu_at_least "1.8.0"; then
var_file_args=""
fi
# shellcheck disable=SC2086
tofu "${tf_chdir_opt}" "${@}" ${var_file_args}
;;
......@@ -440,6 +450,11 @@ if [ $sourced -eq 0 ]; then
;;
"graph")
$should_do_implicit_init && tofu_init
if ! is_tofu_at_least "1.8.0"; then
var_file_args=""
fi
# shellcheck disable=SC2086
tofu "${tf_chdir_opt}" "${@}" ${var_file_args}
;;
......
......@@ -230,3 +230,16 @@ EOF
$SHELL test.sh
}
@test "is_tofu_at_least helper function" {
load $(which gitlab-tofu)
OPENTOFU_VERSION="1.9.1" run is_tofu_at_least "1.8.0"
assert_success
OPENTOFU_VERSION="1.8.0" run is_tofu_at_least "1.8.0"
assert_success
OPENTOFU_VERSION="1.6.3" run is_tofu_at_least "1.8.0"
assert_failure
}