Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Opentofu
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Container Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DBS
gitlab-component
Opentofu
Commits
dbbad579
Unverified
Commit
dbbad579
authored
1 year ago
by
Timo Furrer
Browse files
Options
Downloads
Patches
Plain Diff
Deploy latest image
parent
4d9417a0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+19
-1
19 additions, 1 deletion
.gitlab-ci.yml
tests/integration.gitlab-ci.yml
+0
-2
0 additions, 2 deletions
tests/integration.gitlab-ci.yml
tests/unit.gitlab-ci.yml
+5
-5
5 additions, 5 deletions
tests/unit.gitlab-ci.yml
with
24 additions
and
8 deletions
.gitlab-ci.yml
+
19
−
1
View file @
dbbad579
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
tests/integration.gitlab-ci.yml
+
0
−
2
View file @
dbbad579
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
:
...
...
This diff is collapsed.
Click to expand it.
tests/unit.gitlab-ci.yml
+
5
−
5
View file @
dbbad579
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment