cmd: Add --init
for installing plugins automatically
#1119
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1067
This PR adds a new option,
--init
, to install plugins automatically. This will improve the user experience of plugins on Azure and GCP and make it easier to extend with other plugins.Extend the schema of the configuration to achieve this goal:
The
version
refers to the release tag (without leading "v"), and thesource
refers to the repository in which the plugin is released. At this point, thecf-workers-proxy-8qb.pages.dev
hostname isn't used for anything, but we'll give it for future extensibility.Note that this schema is based on Packer, but does not support version constraints. We will only provide automation for the installation of the specific version first.
The
signing_key
refers GPG public signing key of the third-party plugin developer. Plugins under terraform-linters such as tflint-ruleset-aws and tflint-ruleset-azurerm can use the built-in signing key, so this attribute can be omitted. Other than that, in principle, we encourage you to set a signing key to preventing supply chain attacks.With these attributes are added, if you run the following command, the plugins will be installed automatically.
Plugins that are installed automatically must meet the following rules:
v1.1.1
tflint-ruleset-{name}_{GOOS}_{GOARCH}.zip
tflint-ruleset-{name}
(tflint-ruleset-{name}.exe
in Windows)checksums.txt
If you configure
signing_key
, the release must additionally meet the following rules:checksums.txt.sig
This change does not affect existing plugin systems. If you omit the
version
andsource
, the binaries under.tflint.d/plugins
will be referenced as before. If specified, the binaries will be placed under a directory such as.tflint.d/plugins/github.com/terraform-linters/tflint-ruleset-aws/0.4.0
.TODO