Skip to content

Commit

Permalink
Merge pull request #30 from skilld-labs/artifactlesspropagation
Browse files Browse the repository at this point in the history
Artifactless propagation
  • Loading branch information
davidferlay authored Jan 3, 2025
2 parents 3abaf69 + 6b16572 commit 6a3fbe6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
10 changes: 1 addition & 9 deletions ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func getProjectID(gitlabDomain, username, password, accessToken, repoName string
return fmt.Sprintf("%.0f", projects[0]["id"].(float64)), nil
}

func triggerPipeline(gitlabDomain, username, password, accessToken, projectID, branchName, buildEnv, buildResources, comparisonRef, verbosity string, ansibleDebug bool) (int, error) {
func triggerPipeline(gitlabDomain, username, password, accessToken, projectID, branchName, buildEnv, buildResources, verbosity string, ansibleDebug bool) (int, error) {
apiURL := fmt.Sprintf("%s/api/v4/projects/%s/pipeline?access_token=%s", gitlabDomain, projectID, accessToken)
launchr.Log().Debug("GitLab API URL for triggering pipeline", "url", apiURL)

Expand All @@ -158,14 +158,6 @@ func triggerPipeline(gitlabDomain, username, password, accessToken, projectID, b
},
}

// Only add OVERRIDDEN_COMPARISON_REF if provided
if comparisonRef != "" {
launchr.Log().Info("Appending OVERRIDDEN_COMPARISON_REF to pipelines variables")
data["variables"] = append(data["variables"].([]map[string]string), map[string]string{
"key": "OVERRIDDEN_COMPARISON_REF",
"value": comparisonRef,
})
}
// Only add BUILD_DEBUG_MODE if provided
if ansibleDebug {
launchr.Log().Info("Appending BUILD_DEBUG_MODE to pipelines variables")
Expand Down
12 changes: 1 addition & 11 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ type metaOptions struct {
bin string
verboseCount int
keyringPassphrase string
override string
last bool
skipBump bool
ci bool
Expand Down Expand Up @@ -88,7 +87,6 @@ func (p *Plugin) CobraAddCommands(rootCmd *launchr.Command) error {
},
}
metaCmd.SetArgs([]string{"environment", "tags"}) // TODO: Deprecate tags usage, default to all
metaCmd.Flags().StringVar(&options.override, "override", "", "Bump --sync override option")
metaCmd.Flags().BoolVar(&options.last, "last", false, "Last flag for local bump command")
metaCmd.Flags().BoolVar(&options.skipBump, "skip-bump", false, "Skip execution of bump command")
metaCmd.Flags().BoolVar(&options.ci, "ci", false, "Deprecated option (now default bebavior)")
Expand Down Expand Up @@ -159,11 +157,6 @@ func (p *Plugin) meta(environment, tags string, options metaOptions) error {
launchr.Log().Debug("verbosity level", "level", verbosity)
}

comparisonRef := options.override
if comparisonRef != "" {
launchr.Term().Info().Printfln("Comparison artifact override: %s", comparisonRef)
}

ansibleDebug := options.debug
if ansibleDebug {
launchr.Term().Info().Printfln("Ansible debug mode: %t", ansibleDebug)
Expand Down Expand Up @@ -240,9 +233,6 @@ func (p *Plugin) meta(environment, tags string, options metaOptions) error {

launchr.Term().Println()
bumpSyncArgs := []string{"bump", "--sync"}
if options.override != "" {
bumpSyncArgs = append(bumpSyncArgs, "--override", options.override)
}
bumpSyncArgs = append(bumpSyncArgs, commonArgs...)
syncCmd := keyringCmd(p.createCommand(options.bin, bumpSyncArgs...))
launchr.Term().Println(sanitizeString(syncCmd.String(), options.keyringPassphrase))
Expand Down Expand Up @@ -396,7 +386,7 @@ func (p *Plugin) meta(environment, tags string, options metaOptions) error {
}

// Trigger pipeline
pipelineID, err := triggerPipeline(gitlabDomain, username, password, accessToken, projectID, branchName, environment, tags, comparisonRef, verbosity, ansibleDebug)
pipelineID, err := triggerPipeline(gitlabDomain, username, password, accessToken, projectID, branchName, environment, tags, verbosity, ansibleDebug)
if err != nil {
return fmt.Errorf("failed to trigger pipeline: %w", err)
}
Expand Down

0 comments on commit 6a3fbe6

Please sign in to comment.