options

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLabels

func GetLabels(build Build, github GitHub) []string

GetLabels gets a list of all labels to build the image with including automatic labels created from github vars when AddGitLabels is true

func GetRegistry

func GetRegistry() string

GetRegistry gets the registry server from the github actions environment variables

func GetTags

func GetTags(registry string, github GitHub) ([]string, error)

GetTags gets a list of all tags for including automatic tags from github vars when enabled along with the registry and repository

func ShouldPush

func ShouldPush() (bool, error)

ShouldPush returns true if the user has signalled a docker push should be performed

Types

type Build

type Build struct {
	Path         string `env:"INPUT_PATH"`
	Dockerfile   string `env:"INPUT_DOCKERFILE"`
	AddGitLabels bool   `env:"INPUT_ADD_GIT_LABELS"`
	Target       string `env:"INPUT_TARGET"`
	AlwaysPull   bool   `env:"INPUT_ALWAYS_PULL"`
	CacheFroms   []string
	BuildArgs    []string
	Labels       []string
}

Build contains the parsed build action environment variables

func GetBuildOptions

func GetBuildOptions() (Build, error)

GetBuildOptions gets the login action environment variables

type GitHub

type GitHub struct {
	RunInActions bool   `env:"GITHUB_ACTIONS"`
	Workflow     string `env:"GITHUB_WORKFLOW"`
	Action       string `env:"GITHUB_ACTION"`
	Repository   string `env:"GITHUB_REPOSITORY"`
	EventName    string `env:"GITHUB_EVENT_NAME"`
	Sha          string `env:"GITHUB_SHA"`
	Reference    GitReference
}

GitHub contains the parsed common github actions environment variables See https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables

func GetGitHubOptions

func GetGitHubOptions() (GitHub, error)

GetGitHubOptions gets the common github actions environment variables

type GitReference

type GitReference struct {
	Type GitReferenceType
	Name string
}

GitReference contains the type and name of the git ref

type GitReferenceType

type GitReferenceType int

GitReferenceType is the type of the git ref

const (
	GitRefUnknown GitReferenceType = iota
	GitRefHead
	GitRefPullRequest
	GitRefTag
)

Get reference types

type Login

type Login struct {
	Username string `env:"INPUT_USERNAME"`
	Password string `env:"INPUT_PASSWORD"`
}

Login contains the parsed login action environment variables

func GetLoginOptions

func GetLoginOptions() (Login, error)

GetLoginOptions gets the login action environment variables

Jump to

Keyboard shortcuts

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