deploystack

package module
v1.12.8 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 13 Imported by: 6

README

DeployStack

GoDoc

DeployStack is a one click solution for running Terraform projects for Google Cloud Platfom using Cloud Shell. It uses Open in Cloud Shell to guide users from a link to a series or questions to help them install a Terraform solution in their own Google Cloud Platform project space - prompting them to choose answers to questions like "What [datacenter] zone do you want to install in?" And presenting the options to guide them to pic the settings that are right for them.

DeployStack UX

For technical reasons, at this time, it is limited to working with github repos owned by Google Cloud Platform. You can see a list of DeployStack projects on cloud.google.com.

Authoring

Authoring information has been moved to deploystack/AUTHORING.MD.

This Codebase

This project is to centralize all of the tools and processes to get terminal interfaces for collecting information from users for use with DeployStack. Ultimately this codebase creates an executable that runs on Cloud Shell and works with other tools to drive the experience.

It's broken up into packages with different responsibilities:

deploystack
A top level package that ties together user i/o for the executable and passes information to the other packages
deploystack/config
The basic information schema that runs all of the other parts of the executable.
deploystack/gcloud
Communication with Google Cloud via the Go SDK to get things like region and zone lists
deploystack/github
Communication with Github for cloning and getting other metadata about projects
deploystack/terraform
Introspection of Terraform files for tooling and other metadata
deploystack/tui
A terminal user interface that is dynamically built based on config files rendered using BubbleTea , LipGloss, and Bubbles

Testing this Repo

In order to test the helper app in this repo, we need to do a fair amount of manipulation of projects and what not. The tests require a Service Account key json file. To faciliate this there is a script in tools/credsfile that will create a service account, give it the right access and service enablements, and export out a key file to use with testing.

This is not an offical Google product.

Documentation

Overview

Package deploystack provides a series of interfaces for getting Google Cloud settings and configurations for use with DeplyStack

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttemptRepo added in v1.9.0

func AttemptRepo(name, wd string) (string, github.Repo, error)

AttemptRepo will try to download a repo - only from GoogleCloudPlatform. If it fails, it will append "deploystack-" to the front of the requested name and try again.

func ContactCheck added in v1.9.0

func ContactCheck() gcloud.ContactData

ContactCheck checks the local file system for a file containing domain registar contact info

func ContactSave added in v1.9.0

func ContactSave(i interface{})

ContactSave writes a file containing domain registar contact info to disk if it exists

func DownloadRepo added in v1.8.0

func DownloadRepo(repo github.Repo, path string) (string, error)

DownloadRepo takes a name of a GoogleCloudPlatform repo or a GoogleCloudPlatform/deploystack-[name] repo, and downloads it into a unique folder name, and outputs that name

func Init added in v1.1.0

func Init(path string) (*config.Stack, error)

Init initializes a Deploystack stack by looking on the local file system

func Precheck added in v1.5.0

func Precheck() error

Precheck handles the logic around switching working directories for multiple stacks in one repo

func UniquePath added in v1.8.0

func UniquePath(candidate string) string

UniquePath returns either the input candidate path if it does not exist, or a path like the input candidate with increasing numbers appended to it until the output name is a path that does not exist

func WriteConfig added in v1.9.0

func WriteConfig(dir string, gh github.Repo) error

WriteConfig will drop a .deploystack folder with deploystack.yaml file for repos that do not have one.

Types

type Meta added in v1.8.0

type Meta struct {
	DeployStack config.Config
	Terraform   terraform.Blocks `json:"terraform" yaml:"terraform"`
	Github      github.Repo      `json:"github" yaml:"github"`
	LocalPath   string           `json:"localpath" yaml:"localpath"`
}

Meta is a datastructure that combines the Deploystack, github and Terraform bits of metadata about a stack.

func NewMeta added in v1.8.0

func NewMeta(path string) (Meta, error)

NewMeta allows project to point at local directories for info as well as pulling down from github

func (Meta) ShortName added in v1.8.0

func (m Meta) ShortName() string

ShortName retrieves the shortname of whatever we are calling this stack

func (Meta) ShortNameUnderscore added in v1.8.0

func (m Meta) ShortNameUnderscore() string

ShortNameUnderscore retrieves the shortname of whatever we are calling this stack replacing hyphens with underscores

func (Meta) Suggest added in v1.9.0

func (m Meta) Suggest() (config.Config, error)

Suggest will provide it's best guess of what the deploystack config should be based on the contents of the repo, including an existing deploystack config

Directories

Path Synopsis
cmd
Package config holds all of the data structures for DeployStack.
Package config holds all of the data structures for DeployStack.
The dsexec binary that runs on Cloud Shell to present all of the options to users
The dsexec binary that runs on Cloud Shell to present all of the options to users
dsgithub module
Package dstester is a collection of tools to make testing Terraform resources created for DeployStack easier.
Package dstester is a collection of tools to make testing Terraform resources created for DeployStack easier.
Package gcloud wraps up all of the cloud operations for DeployStack into one client.
Package gcloud wraps up all of the cloud operations for DeployStack into one client.
gcloudtf module
Package github includes all of the client calls to github for building automation tools for deploystack
Package github includes all of the client calls to github for building automation tools for deploystack
Package terraform handles parsing Terraform files to extract structured information out of it, to support a few tools to speed up the DeployStack authoring process
Package terraform handles parsing Terraform files to extract structured information out of it, to support a few tools to speed up the DeployStack authoring process
tui
Package tui provides a BubbleTea powered tui for Deploystack.
Package tui provides a BubbleTea powered tui for Deploystack.

Jump to

Keyboard shortcuts

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