You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the solution you'd like
I would like to be able to configure the seed jobs to use a specific git tag of the repo.
Currently the Jenkins CRD allows you to specify the repositoryBranch of the created seed jobs, so you could in theory point it to the right tag using refs/tags/<tagName>
However this doesnt work because the git SCM of the seed job is configured to not pull tags.
This is because the groovy script created for the seed job initializes the extra options for gitSCM as follows (source here):
def gitExtensions = [
new CloneOption(true, true, ";", 10),
new GitLFSPull()
]
Ideally the Jenkins CRD would include a new optional boolean parameter to enable fetching of tags in the seed job (defaulted as false), which would be used to control the second boolean parameter of the CloneOption in the generated groovy script:
seedJobs:
- id: my-seed-job
targets: ...
description: ...
# using tags is now possible by also including fetchTags: true
repositoryBranch: refs/tags/my-tag
fetchTags: true
repositoryUrl: ...
def gitExtensions = [
// noTags parameter set as true only when FetchTags is false, and viceversa
new CloneOption(/* shallow */ true, /* notags */ {{ ! .FetchTags }}, /* reference */ ";", /* timeout */ 10),
new GitLFSPull()
]
Describe alternatives you've considered
You can only use git branches as the source for the seed job. There is no alternative that lets you use git tags other than manually updating the created seed job to allow fetching tags (but that gets lost if the operator reinitializes jenkins)
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Describe the solution you'd like
I would like to be able to configure the seed jobs to use a specific git tag of the repo.
Currently the Jenkins CRD allows you to specify the
repositoryBranch
of the created seed jobs, so you could in theory point it to the right tag usingrefs/tags/<tagName>
However this doesnt work because the git SCM of the seed job is configured to not pull tags.
This is because the groovy script created for the seed job initializes the extra options for gitSCM as follows (source here):
Where the second boolean of the
CloneOption
constructor corresponds with thenoTags
parameter: https://javadoc.jenkins.io/plugin/git/hudson/plugins/git/extensions/impl/CloneOption.htmlIdeally the Jenkins CRD would include a new optional boolean parameter to enable fetching of tags in the seed job (defaulted as false), which would be used to control the second boolean parameter of the
CloneOption
in the generated groovy script:Describe alternatives you've considered
You can only use git branches as the source for the seed job. There is no alternative that lets you use git tags other than manually updating the created seed job to allow fetching tags (but that gets lost if the operator reinitializes jenkins)
Additional context
N/A
The text was updated successfully, but these errors were encountered: