Skip to content

Commit 8bacaf0

Browse files
committed
Add JenkinsfilePath & inline Jenkinsfile options
1 parent cf0c269 commit 8bacaf0

File tree

6 files changed

+93
-3
lines changed

6 files changed

+93
-3
lines changed

api/swagger-spec/oapi-v1.json

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17702,8 +17702,7 @@
1770217702
"description": "CustomStrategy holds the parameters to the Custom build strategy"
1770317703
},
1770417704
"externalStrategy": {
17705-
"$ref": "v1.ExternalBuildStrategy",
17706-
"description": "holds parameters to the External build strategy"
17705+
"$ref": "v1.ExternalBuildStrategy"
1770717706
}
1770817707
}
1770917708
},
@@ -17929,7 +17928,37 @@
1792917928
},
1793017929
"v1.ExternalBuildStrategy": {
1793117930
"id": "v1.ExternalBuildStrategy",
17932-
"properties": {}
17931+
"required": [
17932+
"type"
17933+
],
17934+
"properties": {
17935+
"type": {
17936+
"type": "string",
17937+
"description": "identifies the type of external build"
17938+
},
17939+
"env": {
17940+
"type": "array",
17941+
"items": {
17942+
"$ref": "v1.EnvVar"
17943+
},
17944+
"description": "additional environment variables you want to pass into an external build"
17945+
},
17946+
"jenkinsPipelineStrategy": {
17947+
"$ref": "v1.JenkinsPipelineStrategy",
17948+
"description": "holds parameters to the Jenkins Pipeline external build strategy"
17949+
}
17950+
}
17951+
},
17952+
"v1.JenkinsPipelineStrategy": {
17953+
"id": "v1.JenkinsPipelineStrategy",
17954+
"properties": {
17955+
"jenkinsfilePath": {
17956+
"type": "string"
17957+
},
17958+
"jenkinsfile": {
17959+
"type": "string"
17960+
}
17961+
}
1793317962
},
1793417963
"v1.BuildOutput": {
1793517964
"id": "v1.BuildOutput",

pkg/api/deep_copy_generated.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,6 +1348,18 @@ func deepCopy_api_ImageSourcePath(in buildapi.ImageSourcePath, out *buildapi.Ima
13481348
}
13491349

13501350
func deepCopy_api_JenkinsPipelineStrategy(in buildapi.JenkinsPipelineStrategy, out *buildapi.JenkinsPipelineStrategy, c *conversion.Cloner) error {
1351+
if in.JenkinsfilePath != nil {
1352+
out.JenkinsfilePath = new(string)
1353+
*out.JenkinsfilePath = *in.JenkinsfilePath
1354+
} else {
1355+
out.JenkinsfilePath = nil
1356+
}
1357+
if in.Jenkinsfile != nil {
1358+
out.Jenkinsfile = new(string)
1359+
*out.Jenkinsfile = *in.Jenkinsfile
1360+
} else {
1361+
out.Jenkinsfile = nil
1362+
}
13511363
return nil
13521364
}
13531365

pkg/api/v1/conversion_generated.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,6 +1707,18 @@ func autoConvert_api_JenkinsPipelineStrategy_To_v1_JenkinsPipelineStrategy(in *b
17071707
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
17081708
defaulting.(func(*buildapi.JenkinsPipelineStrategy))(in)
17091709
}
1710+
if in.JenkinsfilePath != nil {
1711+
out.JenkinsfilePath = new(string)
1712+
*out.JenkinsfilePath = *in.JenkinsfilePath
1713+
} else {
1714+
out.JenkinsfilePath = nil
1715+
}
1716+
if in.Jenkinsfile != nil {
1717+
out.Jenkinsfile = new(string)
1718+
*out.Jenkinsfile = *in.Jenkinsfile
1719+
} else {
1720+
out.Jenkinsfile = nil
1721+
}
17101722
return nil
17111723
}
17121724

@@ -2592,6 +2604,18 @@ func autoConvert_v1_JenkinsPipelineStrategy_To_api_JenkinsPipelineStrategy(in *v
25922604
if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
25932605
defaulting.(func(*v1.JenkinsPipelineStrategy))(in)
25942606
}
2607+
if in.JenkinsfilePath != nil {
2608+
out.JenkinsfilePath = new(string)
2609+
*out.JenkinsfilePath = *in.JenkinsfilePath
2610+
} else {
2611+
out.JenkinsfilePath = nil
2612+
}
2613+
if in.Jenkinsfile != nil {
2614+
out.Jenkinsfile = new(string)
2615+
*out.Jenkinsfile = *in.Jenkinsfile
2616+
} else {
2617+
out.Jenkinsfile = nil
2618+
}
25952619
return nil
25962620
}
25972621

pkg/api/v1/deep_copy_generated.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,18 @@ func deepCopy_v1_ImageSourcePath(in apiv1.ImageSourcePath, out *apiv1.ImageSourc
13701370
}
13711371

13721372
func deepCopy_v1_JenkinsPipelineStrategy(in apiv1.JenkinsPipelineStrategy, out *apiv1.JenkinsPipelineStrategy, c *conversion.Cloner) error {
1373+
if in.JenkinsfilePath != nil {
1374+
out.JenkinsfilePath = new(string)
1375+
*out.JenkinsfilePath = *in.JenkinsfilePath
1376+
} else {
1377+
out.JenkinsfilePath = nil
1378+
}
1379+
if in.Jenkinsfile != nil {
1380+
out.Jenkinsfile = new(string)
1381+
*out.Jenkinsfile = *in.Jenkinsfile
1382+
} else {
1383+
out.Jenkinsfile = nil
1384+
}
13731385
return nil
13741386
}
13751387

pkg/build/api/types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,12 @@ type ExternalBuildStrategy struct {
443443

444444
// JenkinsPipelineStrategy holds parameters specific to a Jenkins Pipeline build.
445445
type JenkinsPipelineStrategy struct {
446+
// JenkinsfilePath is the path of the Jenkinsfile that will be used to configure the pipeline
447+
// relative to the root of the source repository.
448+
JenkinsfilePath *string `json:"jenkinsfilePath,omitempty"`
449+
450+
// Jenkinsfile is the raw contents of a Jenkinsfile containing the pipeline definition.
451+
Jenkinsfile *string `json:"jenkinsfile,omitempty"`
446452
}
447453

448454
// A BuildPostCommitSpec holds a build post commit hook specification. The hook

pkg/build/api/v1/types.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ const (
416416

417417
// ExternalBuildStrategy defines input parameters specific to an External build.
418418
type ExternalBuildStrategy struct {
419+
// Type is the kind of external builder.
419420
Type ExternalBuilderType `json:"type" description:"identifies the type of external build"`
420421

421422
// Env contains additional environment variables you want to pass to the external builder.
@@ -427,6 +428,12 @@ type ExternalBuildStrategy struct {
427428

428429
// JenkinsPipelineStrategy holds parameters specific to a Jenkins Pipeline build.
429430
type JenkinsPipelineStrategy struct {
431+
// JenkinsfilePath is the path of the Jenkinsfile that will be used to configure the pipeline
432+
// relative to the root of the source repository.
433+
JenkinsfilePath *string `json:"jenkinsfilePath,omitempty"`
434+
435+
// Jenkinsfile is the raw contents of a Jenkinsfile containing the pipeline definition.
436+
Jenkinsfile *string `json:"jenkinsfile,omitempty"`
430437
}
431438

432439
// A BuildPostCommitSpec holds a build post commit hook specification. The hook

0 commit comments

Comments
 (0)