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:
- build
- test
- test-integration
- deploy
- release
.opentofu-versions:
parallel:
......@@ -23,7 +25,7 @@ variables:
BASE_IMAGE: "alpine:3.18.4"
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
stage: build
services:
......@@ -51,14 +53,30 @@ gitlab-opentofu-image:
--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,
# create the release.
# create-release:
# stage: release
# image: registry.gitlab.com/gitlab-org/release-cli:latest
# rules:
# - if: $CI_COMMIT_TAG =~ /\d+/
# script: echo "Creating release $CI_COMMIT_TAG"
# release:
# tag_name: $CI_COMMIT_TAG
# description: "Release $CI_COMMIT_TAG of components repository $CI_PROJECT_PATH"
create-release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG =~ /\d+/
script: echo "Creating release $CI_COMMIT_TAG"
release:
tag_name: $CI_COMMIT_TAG
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