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

Deploy and Release

parent 3c1ccbd3
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,8 @@ stages: ...@@ -6,6 +6,8 @@ stages:
- build - build
- test - test
- test-integration - test-integration
- deploy
- release
.opentofu-versions: .opentofu-versions:
parallel: parallel:
...@@ -23,7 +25,7 @@ variables: ...@@ -23,7 +25,7 @@ variables:
BASE_IMAGE: "alpine:3.18.4" BASE_IMAGE: "alpine:3.18.4"
GITLAB_OPENTOFU_IMAGE_NAME: "$CI_REGISTRY_IMAGE/internal/gitlab-opentofu-$OPENTOFU_VERSION:$CI_COMMIT_SHA" GITLAB_OPENTOFU_IMAGE_NAME: "$CI_REGISTRY_IMAGE/internal/gitlab-opentofu-$OPENTOFU_VERSION:$CI_COMMIT_SHA"
gitlab-opentofu-image: gitlab-opentofu-image:build:
extends: .opentofu-versions extends: .opentofu-versions
stage: build stage: build
services: services:
...@@ -51,14 +53,30 @@ gitlab-opentofu-image: ...@@ -51,14 +53,30 @@ gitlab-opentofu-image:
--push --push
. .
gitlab-opentofu-image:deploy:
extends: .opentofu-versions
stage: deploy
image:
name: gcr.io/go-containerregistry/crane:debug
entrypoint: [""]
variables:
RELEASE_IMAGE_NAME: "$CI_REGISTRY_IMAGE/gitlab-opentofu"
RELEASE_SEMVER: "${CI_COMMIT_TAG}+opentofu-${OPENTOFU_VERSION}"
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"
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:
# stage: release stage: release
# image: registry.gitlab.com/gitlab-org/release-cli:latest image: registry.gitlab.com/gitlab-org/release-cli:latest
# rules: rules:
# - if: $CI_COMMIT_TAG =~ /\d+/ - if: $CI_COMMIT_TAG =~ /\d+/
# script: echo "Creating release $CI_COMMIT_TAG" script: echo "Creating release $CI_COMMIT_TAG"
# release: release:
# tag_name: $CI_COMMIT_TAG tag_name: $CI_COMMIT_TAG
# description: "Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH" description: "Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment