aws

package
v0.0.0-...-c93426c Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBuildParametersName = "default"

DefaultBuildParametersName is a key for default build parameters (always selected first)

Variables

This section is empty.

Functions

func FetchTokenIfMissing

func FetchTokenIfMissing(p *Project)

FetchTokenIfMissing gets project token from SSM if SSM name is present but token is not, updates project

func FindCodeBuild

func FindCodeBuild(projConf *Project, buildConf *Build, sha string) (*codebuild.Build, error)

FindCodeBuild returns a corresponding codebuild.Build pointer if found

func GetIAMUserName

func GetIAMUserName() string

GetIAMUserName returns current IAM user name

func GetSSMParameter

func GetSSMParameter(name string) (string, error)

GetSSMParameter fetches a parameter by name from configured region

Types

type Build

type Build struct {
	Name                      string          `json:"name"`
	SearchBuildParameters     BuildParameters `json:"search_build_parameters"`
	SearchCodeBuildParameters BuildParameters `json:"search_code_build_parameters"`
	RunBuildParameters        BuildParameters `json:"run_build_parameters"`
}

Build contains search conditions and identification

func FindBuild

func FindBuild(name string, builds *[]Build) *Build

FindBuild looks for a build by name in a provided slice

func FindBuilds

func FindBuilds(names []string, builds *[]Build) []Build

FindBuilds looks for builds in SSM config by names

type BuildParameters

type BuildParameters map[string]interface{}

BuildParameters is a type of generic parameters map

func (BuildParameters) SatisfiedBy

func (params BuildParameters) SatisfiedBy(other BuildParameters) bool

SatisfiedBy checks if provided map includes all the same values under the same keys as the source

func (BuildParameters) SatisfiedByCodeBuildEnv

func (params BuildParameters) SatisfiedByCodeBuildEnv(envVars []*codebuild.EnvironmentVariable) bool

SatisfiedByCodeBuildEnv checks if provided env variables include all the same values under the same keys as the source build parameters

func (BuildParameters) StringIndent

func (params BuildParameters) StringIndent(indent string) string

StringIndent constructs a string to output BuildParameters with and indent for formatting

type Config

type Config struct {
	Settings `json:"settings"`
	Projects []Project `json:"projects"`
	Builds   []Build   `json:"builds"`
}

Config contains projects and builds along with settings for the crawler

func GetRemoteConfig

func GetRemoteConfig() *Config

GetRemoteConfig returns cached config from SSM or fetches one

type OptionalBuildParameters

type OptionalBuildParameters map[string]BuildParameters

OptionalBuildParameters is a map of BuildParameters

func (OptionalBuildParameters) StringIndent

func (opts OptionalBuildParameters) StringIndent(indent string) string

StringIndent constructs a string to output OptionalBuildParameters with and indent for formatting

type Project

type Project struct {
	Name                    string                  `json:"name"`
	CodeBuildName           string                  `json:"code_build_name"`
	CircleCIURL             string                  `json:"circleci_url"`
	CircleCIToken           string                  `json:"circleci_token"`
	CircleCITokenSSMName    string                  `json:"circleci_token_ssm_name"`
	GitHubURL               string                  `json:"github_url"`
	OptionalBuildParameters OptionalBuildParameters `json:"optional_build_parameters"`
}

Project contains info to fetch builds from CircleCI

func FindProject

func FindProject(name string, projects *[]Project) *Project

FindProject looks for a project by name in the provided slice

func FindProjects

func FindProjects(names []string, projects *[]Project) []Project

FindProjects looks for projects in SSM config by names

type Settings

type Settings struct {
	PerPage   int `json:"per_page"`
	MaxOffset int `json:"max_offset"`
}

Settings is a settings object for the crawler

Jump to

Keyboard shortcuts

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