project

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidGoVersion

func IsValidGoVersion(golangVersion string) (bool, error)

IsValidGoVersion - Checks if the currently installed response from Golang binary version command has GOMOD support

Types

type Project

type Project struct {
	FS   afero.Fs
	Log  *log.Logger
	Path string
}

func NewShoreProject

func NewShoreProject(fs afero.Fs, logger *log.Logger) *Project

func (*Project) GetProjectPath

func (p *Project) GetProjectPath() (string, error)

func (*Project) WriteFile

func (p *Project) WriteFile(fileName, data string) error

WriteFile write a file to the project path

type ProjectInitialize

type ProjectInitialize struct {
	Log     logrus.FieldLogger
	Project Project
}

func (*ProjectInitialize) Init

func (pInit *ProjectInitialize) Init(shoreInit ShoreProjectInit) error

Init - Initializes a shore project

This all or nothing method wraps all the necessary required steps to prep a shore project for a user.

Creates the following files:
- README.md
- E2E.yml
- render.yml
- exec.yml
- jsonnetfile.json
- main.pipeline.jsonnet
- .gitignore
- tests/example_test.libsonnet

Does not run jsonnent-bundler install (`jb install`).

type ShoreProjectInit

type ShoreProjectInit struct {
	Renderer  string
	Backend   string
	Libraries []string
	// contains filtered or unexported fields
}

ShoreProjectInit - Common data structure to initialize a shore project.

func NewShoreProjectInit

func NewShoreProjectInit(projectName, render, backend string, libs []string) ShoreProjectInit

NewShoreProjectInit - Creates a ShoreProjectInit

func (ShoreProjectInit) AppName

func (s ShoreProjectInit) AppName() string

AppName - Creates an Application name that is santized. Aligning with what Spinnaker expects, see comment here: https://github.com/Autodesk/shore/issues/108#issuecomment-1607689

func (ShoreProjectInit) ProjectName

func (s ShoreProjectInit) ProjectName() string

ProjectName Creates a golang matching package name. It is sanitized. Aligning with what Spinnaker expects: https://github.com/spinnaker/deck/blob/5a9768bc6db2f527a73d6b1f5fb3120c101e094b/app/scripts/modules/core/src/pipeline/create/CreatePipelineModal.tsx#L290

Jump to

Keyboard shortcuts

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