Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenTofu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
components
OpenTofu
Commits
ef4a8f0a
Unverified
Commit
ef4a8f0a
authored
1 year ago
by
Timo Furrer
Browse files
Options
Downloads
Patches
Plain Diff
Add jobs subdir
parent
0bf3b35a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/jobs/fmt.yml
+70
-0
70 additions, 0 deletions
templates/jobs/fmt.yml
with
70 additions
and
0 deletions
templates/jobs/fmt.yml
0 → 100644
+
70
−
0
View file @
ef4a8f0a
spec
:
inputs
:
# Job and Stage name
as
:
default
:
'
fmt'
description
:
'
Defines
the
name
of
this
job.'
stage
:
default
:
'
validate'
description
:
'
Defines
the
stage
that
this
job
will
belong
to.'
# Versions
# This version is only required, because we cannot access the context of the component,
# see https://gitlab.com/gitlab-org/gitlab/-/issues/438275
version
:
default
:
'
latest'
description
:
'
Version
of
this
component.
Has
to
be
the
same
as
the
one
in
the
component
include
entry.'
opentofu_version
:
default
:
'
1.6.1'
options
:
-
'
$OPENTOFU_VERSION'
-
'
1.6.1'
-
'
1.6.0'
-
'
1.6.0-rc1'
description
:
'
OpenTofu
version
that
should
be
used.'
# Images
image_registry_base
:
default
:
'
$CI_REGISTRY/components/opentofu'
# FIXME: not yet possible because of https://gitlab.com/gitlab-org/gitlab/-/issues/438722
# gitlab_opentofu_image:
# # FIXME: This should reference the component tag that is used.
# # Currently, blocked by https://gitlab.com/gitlab-org/gitlab/-/issues/438275
# # default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.opentofu_version ]]'
# default: '$CI_REGISTRY/components/opentofu/gitlab-opentofu:$[[ inputs.version ]]-opentofu$[[ inputs.opentofu_version ]]'
# description: 'Tag of the gitlab-opentofu image.'
# Configuration
root_dir
:
default
:
${CI_PROJECT_DIR}
description
:
'
Root
directory
for
the
OpenTofu
project.'
# FIXME: wait for https://gitlab.com/gitlab-org/gitlab/-/merge_requests/142009
# allow_failure:
# default: true
# type: boolean
# description: 'If the job is allowed to fail or not.'
---
'
$[[
inputs.as
]]'
:
stage
:
$[[ inputs.stage ]]
needs
:
[]
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "merge_request_event"
-
if
:
$CI_OPEN_MERGE_REQUESTS
# Don't add it to a *branch* pipeline if it's already in a merge request pipeline.
when
:
never
-
if
:
$CI_COMMIT_BRANCH
# If there's no open merge request, add it to a *branch* pipeline instead.
#allow_failure: $[[ inputs.allow_failure ]]
allow_failure
:
true
cache
:
key
:
"
$[[
inputs.root_dir
]]"
paths
:
-
$[[ inputs.root_dir ]]/.terraform/
variables
:
TF_ROOT
:
$[[ inputs.root_dir ]]
image
:
name
:
'
$[[
inputs.image_registry_base
]]/gitlab-opentofu:$[[
inputs.version
]]-opentofu$[[
inputs.opentofu_version
]]'
script
:
-
gitlab-tofu fmt
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