flora

package module
v0.0.0-...-25f6422 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: MIT Imports: 17 Imported by: 0

README

flora

Build Status

Version/upgrade manager for terraform

What is it

Flora is another and missing upgrade and version manager for Terraform. Inspired by tfenv and written in go. You can use it to upgrade your Terraform version by one command. Another use case: to switch between Terraform versions to use compatible with your .tf manifests Terraform binary.

Features

  • Upgrade your Terraform by one command
  • Switch between Terraform versions easy, fast and without pain
  • Bash/Zsh autocompletion. Even for versions.

Install

  1. By brew install
brew install ketchoop/homebrew-tap/flora

mkdir -p ~/.flora/.bin
  1. By go get
go get -u github.com/ketchoop/flora/cmd/flora

mkdir -p ~/.flora/.bin
  1. By install.sh
curl https://raw.githubusercontent.com/ketchoop/flora/master/install.sh | bash

All of installation ways require existing of ~/.flora/bin directory and path to it in your PATH. So...

Add to PATH:

echo 'export PATH=$PATH:$HOME/.flora/bin' >> .path_to_your_rc_file # .bashrc, .zshrc and so on

source .path_to_your_rc_file # To update state of PATH env

Usage(short description)

NAME:
   flora - Simple app to upgrade your terraform

USAGE:
   flora [global options] command [command options] [arguments...]

VERSION:
   0.1.0

COMMANDS:
     upgrade   Upgrade terraform
     download  Download specific Terraform version
     use       Download(when it's needed) and use specific terraform version
     versions  List all available terraform versions
     help, h   Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

How it works

Like rbenv like tools it downloads binary of Terraform and links it to special folder (~/.flora/bin), which path have to be in you PATH env. When you switch between versions flora links another version to bin folder.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentVersion

func GetCurrentVersion(floraPath string) (ver *version.Version, err error)

func GetLatestVersion

func GetLatestVersion() (string, error)

func GetLatestVersionMatchingConstraint

func GetLatestVersionMatchingConstraint(versionConstraint string) string

func GetVersionConstraint

func GetVersionConstraint() string

func ListLocalVersions

func ListLocalVersions(floraPath string) ([]*version.Version, error)

func ListRemoteVersions

func ListRemoteVersions() ([]*version.Version, error)

func VersionsCompletion

func VersionsCompletion(c *cli.Context)

Types

type TerraformUpgrader

type TerraformUpgrader struct {
	Version   string
	FloraPath string
}

func (TerraformUpgrader) DownloadTerraform

func (t TerraformUpgrader) DownloadTerraform() error

func (TerraformUpgrader) InstallNewTerraform

func (t TerraformUpgrader) InstallNewTerraform() error

func (TerraformUpgrader) IsDownloadNeeded

func (t TerraformUpgrader) IsDownloadNeeded() bool

func (TerraformUpgrader) Run

func (t TerraformUpgrader) Run() error

func (TerraformUpgrader) UnzipAndClean

func (t TerraformUpgrader) UnzipAndClean() error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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