Skip to content

Support for GitLab CI/CD Components #1

@scuba10steve

Description

@scuba10steve

What problem are you trying to solve?

For reference, here's a blog post that announced CI / CD components becoming generally available.

Having the ability to translate from the older style template inclusion to components would be helpful.

Example for migration: opentofu template -> opentofu component

What precondition(s) should be checked before applying this recipe?

Describe the situation before applying the recipe

This is not an extensive example, just a snippet

include:
  - template: OpenTofu/Base.latest.gitlab-ci.yml

Describe the situation after applying the recipe

include:
  - component: $CI_SERVER_FQDN/components/opentofu/job-templates@~latest
    inputs:
      # The version must currently be specified explicitly as an input,
      # to find the correctly associated images. # This can be removed
      # once https://gitlab.com/gitlab-org/gitlab/-/issues/438275 is solved.
      version: ~latest
      opentofu_version: 1.6.0

Have you considered any alternatives or workarounds?

Only alternative is to follow the aformentioned migration guide(s) that may or may not be available

Are you interested in contributing this recipe to OpenRewrite?

Yes, I would be interested in helping contribute this recipe.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions