-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added cosign plugin in the dynamic buildkite template (#20)
* In addition to command line options, a dynamic buildkite template will provide config.yaml for overrides * updte main.go * updte main.go * Added cosign plugin in the dynamic buildkite template * update README.md * update pipeline test.go * update output to default stderr * deleted github util.go file * update * updated the code as per the review notes * adding co-sign * updated bug fix * version fix and update * update README and cosign file * Update varname correctly * added docker metatadata plugin * update plugin step * update test file * update conf.yaml keyless is false * add ssm plugin config * update pugin and test file * updated keyless for cosign * Added docker build plugin into the dynamic template * updated conf file * updated conf file * updated conf file * changed the order of the plugins * changed the order of the plugins and conf file
- Loading branch information
1 parent
95a423d
commit 258055a
Showing
23 changed files
with
736 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cmd | ||
|
||
import ( | ||
"dynamic-buildkite-template/generator" | ||
"strings" | ||
|
||
log "github.com/sirupsen/logrus" | ||
|
||
"github.com/spf13/viper" | ||
) | ||
|
||
var ( | ||
cosignPluginConfig generator.CosignPluginConfig | ||
) | ||
|
||
// LoadCosignConfigs loads cosign plugin configuration from conf.yaml using "plugins.cosign" key | ||
func LoadCosignConfigs() { | ||
// load from config | ||
s := viper.Sub("plugins.cosign") | ||
if s == nil { | ||
log.Warn("Cosign Plugin configuration not found in the config file. .") | ||
return | ||
} | ||
|
||
log.Info("Cosign plugin found in the config file") | ||
|
||
err := s.Unmarshal(&cosignPluginConfig) // unmarshal to the cosignPluginConfig object | ||
if err != nil { | ||
log.Error("Error unmarshalling cosign plugin from config file", err) | ||
return | ||
} | ||
|
||
// fetch latest cosign plugin version, if not defined in the config | ||
if strings.TrimSpace(cosignPluginConfig.CosignVersion) == "" { | ||
cosignPluginConfig.CosignVersion = GetLatestPluginTag("cosign-buildkite-plugin") | ||
} | ||
g.CosignConfig = cosignPluginConfig | ||
// mark cosign plugin as enabled | ||
g.CosignPluginEnabled = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cmd | ||
|
||
import ( | ||
"dynamic-buildkite-template/generator" | ||
"strings" | ||
|
||
log "github.com/sirupsen/logrus" | ||
|
||
"github.com/spf13/viper" | ||
) | ||
|
||
var ( | ||
dockerBuildPluginConfig generator.DockerBuildConfig | ||
) | ||
|
||
// LoadDockerBuildConfigs loads docker build plugin configuration from conf.yaml using "plugins.docker-build" key | ||
func LoadDockerBuildConfigs() { | ||
// load from config | ||
s := viper.Sub("plugins.docker-build") | ||
if s == nil { | ||
log.Warn("Docker Build Plugin configuration not found in the config file. .") | ||
return | ||
} | ||
|
||
log.Info("Docker Build plugin found in the config file") | ||
|
||
err := s.Unmarshal(&dockerBuildPluginConfig) // unmarshal to the dockerBuildPluginConfig object | ||
if err != nil { | ||
log.Error("Error unmarshalling docker plugin from config file", err) | ||
return | ||
} | ||
|
||
// fetch latest docker build plugin version, if not defined in the config | ||
if strings.TrimSpace(dockerBuildPluginConfig.Version) == "" { | ||
dockerBuildPluginConfig.Version = GetLatestPluginTag("docker-build-buildkite-plugin") | ||
} | ||
g.DockerBuildConfig = dockerBuildPluginConfig | ||
// mark docker build plugin as enabled | ||
g.DockerBuildPluginEnabled = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cmd | ||
|
||
import ( | ||
"dynamic-buildkite-template/generator" | ||
"strings" | ||
|
||
log "github.com/sirupsen/logrus" | ||
|
||
"github.com/spf13/viper" | ||
) | ||
|
||
var ( | ||
dockermetadaPluginConfig generator.DockerMetadataPluginConfig | ||
) | ||
|
||
// LoadDockerMetaDataConfigs loads docker metadata plugin configuration from conf.yaml using "plugins.dockermetadata" key | ||
func LoadDockerMetaDataConfigs() { | ||
// load from config | ||
s := viper.Sub("plugins.docker-metadata") | ||
if s == nil { | ||
log.Warn("docker-metadata Plugin configuration not found in the config file. .") | ||
return | ||
} | ||
|
||
log.Info("docker-metadata plugin found in the config file") | ||
|
||
err := s.Unmarshal(&dockermetadaPluginConfig) // unmarshal to the dockermetadataPluginConfig object | ||
if err != nil { | ||
log.Error("Error unmarshalling docker-metadata plugin from config file", err) | ||
return | ||
} | ||
|
||
// fetch latest docker-metadata plugin version, if not defined in the config | ||
if strings.TrimSpace(dockermetadaPluginConfig.Version) == "" { | ||
dockermetadaPluginConfig.Version = GetLatestPluginTag("docker-metadata-buildkite-plugin") | ||
} | ||
g.DockerMetadataConfig = dockermetadaPluginConfig | ||
// mark docker-metadata plugin as enabled | ||
g.DockerMetadataPluginEnabled = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package cmd | ||
|
||
import ( | ||
"dynamic-buildkite-template/generator" | ||
"strings" | ||
|
||
log "github.com/sirupsen/logrus" | ||
|
||
"github.com/spf13/viper" | ||
) | ||
|
||
var ( | ||
ssmPluginConfig generator.SSMPluginConfig | ||
) | ||
|
||
// LoadDockerMetaDataConfigs loads ssm-buildkite plugin configuration from conf.yaml using "plugins.dockermetadata" key | ||
func LoadSSMDataConfigs() { | ||
// load from config | ||
s := viper.Sub("plugins.ssm-buildkite-plugin") | ||
if s == nil { | ||
log.Warn("ssm-buildkite Plugin configuration not found in the config file. .") | ||
return | ||
} | ||
|
||
log.Info("ssm-buildkite plugin found in the config file") | ||
|
||
err := s.Unmarshal(&ssmPluginConfig) // unmarshal to the dockermetadataPluginConfig object | ||
if err != nil { | ||
log.Error("Error unmarshalling ssm-buildkite plugin from config file", err) | ||
return | ||
} | ||
|
||
// fetch latest ssm-buildkite plugin version, if not defined in the config | ||
if strings.TrimSpace(ssmPluginConfig.Version) == "" { | ||
ssmPluginConfig.Version = GetLatestPluginTag("ssm-buildkite-plugin") | ||
} | ||
g.SSMConfig = ssmPluginConfig | ||
// mark ssm-buildkite plugin as enabled | ||
g.SSMPluginEnabled = true | ||
} |
Oops, something went wrong.