Skip to content

Commit

Permalink
add-pipeline-job-option-to-control-using-build-cache (#104)
Browse files Browse the repository at this point in the history
* Added option

* Set ref

* Re-generated client

* Added override use cache option
  • Loading branch information
satr authored Aug 26, 2024
1 parent a8e1249 commit 2160624
Show file tree
Hide file tree
Showing 121 changed files with 1,138 additions and 720 deletions.
11 changes: 8 additions & 3 deletions cmd/createBuildDeployPipelineJob.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package cmd
import (
"errors"

"github.com/equinor/radix-cli/pkg/model"
log "github.com/sirupsen/logrus"

"github.com/equinor/radix-cli/generated-client/client/application"
Expand All @@ -26,6 +27,8 @@ import (
"github.com/spf13/cobra"
)

var overrideUseBuildCache model.BoolPtr

// createBuildDeployApplicationCmd represents the buildApplication command
var createBuildDeployApplicationCmd = &cobra.Command{
Use: "build-deploy",
Expand All @@ -44,7 +47,6 @@ var createBuildDeployApplicationCmd = &cobra.Command{
if appName == nil || *appName == "" || branch == "" {
return errors.New("application name and branch are required")
}

cmd.SilenceUsage = true

apiClient, err := client.GetForCommand(cmd)
Expand All @@ -55,8 +57,9 @@ var createBuildDeployApplicationCmd = &cobra.Command{
triggerPipelineParams := application.NewTriggerPipelineBuildDeployParams()
triggerPipelineParams.SetAppName(*appName)
triggerPipelineParams.SetPipelineParametersBuild(&models.PipelineParametersBuild{
Branch: branch,
CommitID: commitID,
Branch: branch,
CommitID: commitID,
OverrideUseBuildCache: overrideUseBuildCache.Get(),
})

newJob, err := apiClient.Application.TriggerPipelineBuildDeploy(triggerPipelineParams, nil)
Expand All @@ -79,5 +82,7 @@ func init() {
createBuildDeployApplicationCmd.Flags().StringP(flagnames.Branch, "b", "master", "Branch to build-deploy from")
createBuildDeployApplicationCmd.Flags().StringP(flagnames.CommitID, "i", "", "Commit id")
createBuildDeployApplicationCmd.Flags().BoolP(flagnames.Follow, "f", false, "Follow build-deploy")
createBuildDeployApplicationCmd.Flags().Var(&overrideUseBuildCache, flagnames.UseBuildCache, "Optional. Overrides configured or default useBuildCache option. It is applicable when the useBuildKit option is set as true.")

setContextSpecificPersistentFlags(createBuildDeployApplicationCmd)
}
28 changes: 27 additions & 1 deletion generated-client/client/application/application_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2160624

Please sign in to comment.