bootstrap

package
v1.1.38 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package bootstrap handles initial installation for Thelma. It will: * Create skeleton config.yaml with `home` set to THELMA_HOME * Prompt the user for options:

  • Prepend PATH with thelma’s bundled tools (this includes kubectl, helm, helmfile, vault client, and more)? Y/n
  • Enable shell completion for Thelma commands? Y/n

* Generate ~/.thelma/shell/completion.zsh

  • This is trivial thanks to Cobra’s neat shell completion feature!

* Generate ~/.thelma/shell/thelma.zsh, which

  • Includes a “Warning: auto-generated by Thelma’s bootstrap process; do not manually edit this file!” comment
  • Adds ~/.thelma/releases/current/bin to PATH
  • Adds ~/.thelma/releases/current/tools/bin to PATH (if user answered “yes”)
  • Enables shell completion (if user answered “yes”)
  • source ~/.thelma/shell/completion.zsh && compdef _thelma thelma

* Add the following line to ~/.zshrc if it does not exist:

  • [ -f ~/.thelma/shell/thelma.zsh ] && source .thelma/shell/thelma.zsh
  • .zshrc will backed up to ~/.zshrc.bak before writing changes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bootstrapper

type Bootstrapper interface {
	// Bootstrap will bootstrap a thelma installation, including:
	// * creating skeleton config.yaml with `home` set to THELMA_HOME
	// * generating shell scripts that:
	//    * add `thelma` to path
	//    * optionally add thelma's bundled tools to PATH
	//    * optionally set up shell completion for thelma
	// * updating user's ~/.zshrc to source thelma's shell init script
	Bootstrap() error
}

func New

func New(root root.Root, config config.Config, runner shell.Runner) Bootstrapper

New returns a new Bootstrapper

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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