Documentation ¶
Index ¶
- Constants
- func FetchTokenIfMissing(p *Project)
- func FindCodeBuild(projConf *Project, buildConf *Build, sha string) (*codebuild.Build, error)
- func GetIAMUserName() string
- func GetSSMParameter(name string) (string, error)
- type Build
- type BuildParameters
- type Config
- type OptionalBuildParameters
- type Project
- type Settings
Constants ¶
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 ¶
FindCodeBuild returns a corresponding codebuild.Build pointer if found
func GetSSMParameter ¶
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 FindBuilds ¶
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 ¶
FindProject looks for a project by name in the provided slice
func FindProjects ¶
FindProjects looks for projects in SSM config by names