updater

package module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2024 License: MIT Imports: 9 Imported by: 0

README

terraform-version-updater

Automatically update .terraform-version

test Coverage Status

Install

Download latest binary from https://github.com/sue445/terraform-version-updater/releases

Build

go install github.com/sue445/terraform-version-updater@latest

Example

cd /path/to/terraform-repo

# Update terraform to latest version
terraform-version-updater

# Update terraform to latest version (dry-run)
terraform-version-updater --dry-run

# Update terraform to specified version
terraform-version-updater --target 1.8.5

# Update terraform to latest version with specified .terraform-version file
terraform-version-updater --file /path/to/.terraform-version

# Show terraform-version-updater's version
terraform-version-updater --version

Usage

$ terraform-version-updater --help
Usage of terraform-version-updater:
  -d, --dry-run         Whether dry-run
  -f, --file string     Path to .terraform-version file (default ".terraform-version")
  -h, --help            Whether show help
  -t, --target string   Version to be updated (default "latest")
  -v, --version         Whether showing version

vs tfupdate

  • terraform-version-updater supports .terraform-version
  • tfupdate supports required_version in *.tf

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTerraformStableVersions

func GetTerraformStableVersions() ([]string, error)

GetTerraformStableVersions returns all stable versions from https://releases.hashicorp.com/terraform/

func UpdateTerraformVersion

func UpdateTerraformVersion(params *UpdateTerraformVersionParams) string

UpdateTerraformVersion updates version in .terraform-version

Types

type UpdateTerraformVersionParams

type UpdateTerraformVersionParams struct {
	Src           string
	TargetVersion string
	Versions      []string
}

UpdateTerraformVersionParams represents UpdateTerraformVersion's params

type Updater

type Updater struct {
	IsDryRun bool
}

Updater updates .terraform-version

func NewUpdater

func NewUpdater(isDryRun bool) *Updater

NewUpdater returns new Updater's instance

func (*Updater) Execute

func (u *Updater) Execute(targetVersion string, terraformVersionPath string) error

Execute performs major processing for updater

func (*Updater) Info

func (u *Updater) Info(message string)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL