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

Deploy latest image

parent 4d9417a0
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ stages:
variables:
# OpenTofu variables
STABLE_OPENTOFU_VERSION: '1.6.0'
LATEST_OPENTOFU_VERSION: '1.6.0'
# OpenTofu image build variables:
DOCKER_DIND_IMAGE: "docker:24.0.7-dind"
......@@ -69,6 +69,24 @@ gitlab-opentofu-image:deploy:
rules:
- if: $CI_COMMIT_TAG
gitlab-opentofu-image:latest:deploy:
stage: deploy
image:
name: gcr.io/go-containerregistry/crane:debug
entrypoint: [""]
variables:
OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
RELEASE_IMAGE_NAME: "$CI_REGISTRY_IMAGE/gitlab-opentofu"
RELEASE_SEMVER: "${CI_COMMIT_TAG}+opentofu"
before_script:
- crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
script:
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE_NAME:$RELEASE_SEMVER"
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE_NAME:$CI_COMMIT_TAG"
- crane copy "$GITLAB_OPENTOFU_IMAGE_NAME" "$RELEASE_IMAGE_NAME:latest"
rules:
- if: $CI_COMMIT_TAG
# If the pipeline is for a new tag with a semantic version, and all previous jobs succeed,
# create the release.
create-release:
......
component:
stage: test-integration
variables:
IMAGE: $OPENTOFU_IMAGE_NAME
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION
TF_STATE_NAME: ci-integration-$CI_PIPELINE_IID-$CI_NODE_INDEX
TF_ROOT: tests/terraform
trigger:
......
......@@ -149,7 +149,7 @@ gitlab-tofu-init-with-prepared-registry-token:
- .gitlab-tofu-test
stage: test
variables:
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION
OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
script:
- apk add --update $PKG
- |
......@@ -175,7 +175,7 @@ gitlab-tofu-init-without-prepared-registry-token:
- .gitlab-tofu-test
stage: test
variables:
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION
OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
script:
- apk add --update $PKG
- |
......@@ -252,7 +252,7 @@ gitlab-tofu-source-script:
- .gitlab-tofu-test
stage: test
variables:
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION
OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
before_script:
- !reference [.gitlab-tofu-test-base, before_script]
- apk add --update $PKG
......@@ -288,7 +288,7 @@ gitlab-tofu-without-implicit-init:
stage: test
cache:
variables:
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION
OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
STATE_NAME: $CI_JOB_NAME
script:
- export TF_IMPLICIT_INIT=false
......@@ -314,7 +314,7 @@ gitlab-tofu-no-wrapper:
stage: test
cache:
variables:
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION
OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
STATE_NAME: $CI_JOB_NAME
script:
# NOTE: running `gitlab-tofu apply` wouldn't fail
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment