Woodpecker CI Plugins
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

wp-opentofu

Build Status Docker Hub Quay.io Go Report Card GitHub contributors Source: GitHub License: Apache-2.0

Woodpecker CI plugin to manage infrastructure with OpenTofu.

Usage

steps:
  - name: tofu
    image: quay.io/thegeeklab/wp-opentofu
    settings:
      actions:
        - validate
        - plan

Parameters

action optional list
Tofu actions to execute.
Default: validate,plan,apply
environment optional map

Plugin environment variables exposed to all tofu commands. In contrast to the step environment, this option can be used if environment variables are to be used in conjunction with from_secret. Example:

steps:
- name: tofu
  image: quay.io/thegeeklab/wp-opentofu
  settings:
    actions:
      - plan
    environment:
      AWS_ACCESS_KEY_ID:
        from_secret: AWS_ACCESS_KEY_ID
      AWS_SECRET_ACCESS_KEY:
        from_secret: AWS_SECRET_ACCESS_KEY
Default: none
fmt_option optional string
Options for the fmt command, see the OpenTofu fmt command documentation.
Default: none
init_option optional string
Tofu init command options, see the OpenTofu init command documentation.
Default: none
insecure_skip_verify optional bool
Skip SSL verification.
Default: false
log_level optional string
Plugin log level.
Default: info
no_log optional bool
Suppress tofu command output for plan, apply and destroy action.
Default: false
parallelism optional integer
Number of concurrent operations.
Default: 0
refresh optional bool
Enables refreshing of the state before plan and apply commands.
Default: true
root_dir optional string
Root directory where the tofu files live.
Default: none
targets optional list
Targets to run plan or apply action on.
Default: none
tofu_version optional string
Tofu version to use.
Default: none

Build

Build the binary with the following command:

make build

Build the Container image with the following command:

docker build --file Containerfile.multiarch --tag thegeeklab/wp-opentofu .

Test

docker run --rm \
  -e PLUGIN_ACTION=validate \
  -v $(pwd):/build:z \
  -w /build \
   thegeeklab/wp-opentofu