GHPRB Job DSL for pipelines breaks with Job DSL >= 1.70
See original GitHub issueGHPRB Job DSL for pipelines breaks with Job DSL >= 1.70
If I understand correctly, the GHPRB Job DSL example tracks the GitHub repo specified in the scm
, git
, remote
context - see the example Job DSL below taken from the plugin site.
However, support for the scm{}
context (and others) has been dropped for Pipeline Jobs in Job DSL 1.70 (see https://github.com/jenkinsci/job-dsl-plugin/wiki/Migration#migrating-to-170).
If scm{}
is deprecated, it would seem that the remote for tracking must be specified some other way.
pipelineJob('example') {
scm {
git {
remote {
github('test-owner/test-project')
refspec('+refs/pull/*:refs/remotes/origin/pr/*')
}
branch('${sha1}')
}
}
triggers {
githubPullRequest {
admin('user_1')
admins(['user_2', 'user_3'])
userWhitelist('you@you.com')
userWhitelist(['me@me.com', 'they@they.com'])
orgWhitelist('my_github_org')
orgWhitelist(['your_github_org', 'another_org'])
cron('H/5 * * * *')
triggerPhrase('OK to test')
onlyTriggerPhrase()
useGitHubHooks()
permitAll()
autoCloseFailedPullRequests()
allowMembersOfWhitelistedOrgsAsAdmin()
extensions {
commitStatus {
context('deploy to staging site')
triggeredStatus('starting deployment to staging site...')
startedStatus('deploying to staging site...')
statusUrl('http://mystatussite.com/prs')
completedStatus('SUCCESS', 'All is well')
completedStatus('FAILURE', 'Something went wrong. Investigate!')
completedStatus('PENDING', 'still in progress...')
completedStatus('ERROR', 'Something went really wrong. Investigate!')
}
}
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Problems with deprecated DSL regarding ...
The recent release of the Job DSL Plugin broke several jobs that were previously working due to 'deprecating' features for pipelineJobs.
Read more >pipelineJob - Jenkins Job DSL Plugin
Create or updates a pipeline job. Requires Pipeline: Job Since 1.47. pipelineJob(String name) {}. Create or updates a pipeline job.
Read more >Migrating to 1.81
The following methods in the pipelineJob are deprecated and will be removed because they are not available for the Pipeline job type. DSL...
Read more >How to configure a Jenkins pipelineJob via jenkins job dsl ...
pipelineJob("Test GHPRB") { properties { pipelineTriggers { triggers { githubPullRequest { useGitHubHooks() orgWhitelist('orgName') ...
Read more >Online Meetup: From Freestyle jobs to Pipeline, with JobDSL
Recording of the Online Jenkins Meetup on May 19, 2020. Presenter: Nicolaj Græsholt, Eficode Praqma. Journey with Nicolaj, as he talks about ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Having just helped diagnose a problem updating a pipeline job to seed correctly with a newer version of the Job DSL plugin, I think what you want is pipelineJob -> definition -> cpsScm -> scm. I’ve only tested it with Job DSL 1.67 so far, but it looks like it should continue working past the deprecation of the top-level
scm
context you’re worried about; all of those contexts are still present in the 1.70 documentation.@danielstoian you still get a deprecation warning