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

Deploy latest image

parent 4d9417a0
Branches
Tags
No related merge requests found
...@@ -17,7 +17,7 @@ stages: ...@@ -17,7 +17,7 @@ stages:
variables: variables:
# OpenTofu variables # OpenTofu variables
STABLE_OPENTOFU_VERSION: '1.6.0' LATEST_OPENTOFU_VERSION: '1.6.0'
# OpenTofu image build variables: # OpenTofu image build variables:
DOCKER_DIND_IMAGE: "docker:24.0.7-dind" DOCKER_DIND_IMAGE: "docker:24.0.7-dind"
...@@ -69,6 +69,24 @@ gitlab-opentofu-image:deploy: ...@@ -69,6 +69,24 @@ gitlab-opentofu-image:deploy:
rules: rules:
- if: $CI_COMMIT_TAG - 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, # If the pipeline is for a new tag with a semantic version, and all previous jobs succeed,
# create the release. # create the release.
create-release: create-release:
......
component: component:
stage: test-integration stage: test-integration
variables: variables:
IMAGE: $OPENTOFU_IMAGE_NAME
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION
TF_STATE_NAME: ci-integration-$CI_PIPELINE_IID-$CI_NODE_INDEX TF_STATE_NAME: ci-integration-$CI_PIPELINE_IID-$CI_NODE_INDEX
TF_ROOT: tests/terraform TF_ROOT: tests/terraform
trigger: trigger:
......
...@@ -149,7 +149,7 @@ gitlab-tofu-init-with-prepared-registry-token: ...@@ -149,7 +149,7 @@ gitlab-tofu-init-with-prepared-registry-token:
- .gitlab-tofu-test - .gitlab-tofu-test
stage: test stage: test
variables: variables:
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
script: script:
- apk add --update $PKG - apk add --update $PKG
- | - |
...@@ -175,7 +175,7 @@ gitlab-tofu-init-without-prepared-registry-token: ...@@ -175,7 +175,7 @@ gitlab-tofu-init-without-prepared-registry-token:
- .gitlab-tofu-test - .gitlab-tofu-test
stage: test stage: test
variables: variables:
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
script: script:
- apk add --update $PKG - apk add --update $PKG
- | - |
...@@ -252,7 +252,7 @@ gitlab-tofu-source-script: ...@@ -252,7 +252,7 @@ gitlab-tofu-source-script:
- .gitlab-tofu-test - .gitlab-tofu-test
stage: test stage: test
variables: variables:
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
before_script: before_script:
- !reference [.gitlab-tofu-test-base, before_script] - !reference [.gitlab-tofu-test-base, before_script]
- apk add --update $PKG - apk add --update $PKG
...@@ -288,7 +288,7 @@ gitlab-tofu-without-implicit-init: ...@@ -288,7 +288,7 @@ gitlab-tofu-without-implicit-init:
stage: test stage: test
cache: cache:
variables: variables:
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
STATE_NAME: $CI_JOB_NAME STATE_NAME: $CI_JOB_NAME
script: script:
- export TF_IMPLICIT_INIT=false - export TF_IMPLICIT_INIT=false
...@@ -314,7 +314,7 @@ gitlab-tofu-no-wrapper: ...@@ -314,7 +314,7 @@ gitlab-tofu-no-wrapper:
stage: test stage: test
cache: cache:
variables: variables:
OPENTOFU_VERSION: $STABLE_OPENTOFU_VERSION OPENTOFU_VERSION: $LATEST_OPENTOFU_VERSION
STATE_NAME: $CI_JOB_NAME STATE_NAME: $CI_JOB_NAME
script: script:
# NOTE: running `gitlab-tofu apply` wouldn't fail # NOTE: running `gitlab-tofu apply` wouldn't fail
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment