Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-pipeline-job-option-to-control-using-build-cache #104

Merged
merged 4 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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