File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,8 @@ type CiConfig struct {
8585 UseBlobStorageConfigInCiWorkflow bool `env:"USE_BLOB_STORAGE_CONFIG_IN_CI_WORKFLOW" envDefault:"true"`
8686 BaseLogLocationPath string `env:"BASE_LOG_LOCATION_PATH" envDefault:"/home/devtron/"`
8787 InAppLoggingEnabled bool `env:"IN_APP_LOGGING_ENABLED" envDefault:"false"`
88+ DefaultTargetPlatform string `env:"DEFAULT_TARGET_PLATFORM" envDefault:""`
89+ UseBuildx bool `env:"USE_BUILDX" envDefault:"false"`
8890 ClusterConfig * rest.Config
8991 NodeLabel map [string ]string
9092 EnableBuildContext bool `env:"ENABLE_BUILD_CONTEXT" envDefault:"false"`
Original file line number Diff line number Diff line change @@ -461,6 +461,15 @@ func (impl *CiServiceImpl) buildWfRequestForCiPipeline(pipeline *pipelineConfig.
461461 buildPackConfig := ciBuildConfigBean .BuildPackConfig
462462 checkoutPath = filepath .Join (checkoutPath , buildPackConfig .ProjectPath )
463463 }
464+
465+ defaultTargetPlatform := impl .ciConfig .DefaultTargetPlatform
466+ useBuildx := impl .ciConfig .UseBuildx
467+
468+ if ciBuildConfigBean .DockerBuildConfig != nil && ciBuildConfigBean .DockerBuildConfig .TargetPlatform == "" && useBuildx {
469+ ciBuildConfigBean .DockerBuildConfig .TargetPlatform = defaultTargetPlatform
470+ ciBuildConfigBean .DockerBuildConfig .UseBuildx = useBuildx
471+ }
472+
464473 workflowRequest := & WorkflowRequest {
465474 WorkflowNamePrefix : strconv .Itoa (savedWf .Id ) + "-" + savedWf .Name ,
466475 PipelineName : pipeline .Name ,
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ type DockerBuildConfig struct {
3535 LanguageFramework string `json:"languageFramework,omitempty"`
3636 DockerBuildOptions map [string ]string `json:"dockerBuildOptions,omitempty"`
3737 BuildContext string `json:"buildContext,omitempty"`
38+ UseBuildx bool `json:"useBuildx"`
3839}
3940
4041type BuildPackConfig struct {
You can’t perform that action at this time.
0 commit comments