-
Notifications
You must be signed in to change notification settings - Fork 136
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
Pipeline plugin compatibility (Formerly Workflow plugin) #92
Comments
How does this handle credentials? |
It looks like they reference them by ID, e.g:
|
Probably suffices to implement |
is there any known possible workaround? Something like?
|
Sure, yes, you could just use official stash\bitbucket server documentation https://developer.atlassian.com/stash/docs/latest/how-tos/updating-build-status-for-commits.html |
Hi, |
BTW @scaytrase, |
Use default branch (release/1.x currently) as target |
Could you post a sample build file to represent the case-branching model (inprogress, fail, success) |
@scaytrase, sure, will do it later. Now I have to get back to work. |
Okey, just wan't to see how it will look like to give opinion. I've personally dislike the idea to store so much information in scripts (too much coupling to the infrastructue) |
There appears to be Github Commit Status Notifier step that seems very similar, that can can be used from the Snippet editor. step([$class: 'GitHubCommitStatusSetter', commitShaSource: [$class: 'ManuallyEnteredShaSource', sha: '123456'], statusResultSource: [$class: 'ConditionalStatusResultSource', results: [[$class: 'AnyBuildResult', message: 'Foo Bar', state: 'FAILURE']]]]) It would probably be good to model it on that. |
@scaytrase node('master') {
_WORKSPACE=pwd()
for ( repository in ['repository1', 'repository2', 'repository3'] ) {
stage repository+'-verification' // repository1-verification
dir(_WORKSPACE+'/'+repository) {
git "https://mybb.org/project/${repository}.git"
// Somehow get commit sha1
notify(repository,'aabbcc','INPROGRESS')
try {
echo 'do the build/test/whatever'
} catch (e) {
notify(repository,'aabbcc','FAILED')
error e
}
notify(repository,'aabbcc','SUCCESS')
}
}
}
def notify(repository,sha1,status) {
step([$class: 'StashNotifier',
buildState: status,
commitSha1: sha1,
credentialsId: '1111-2222-3333-4444',
disableInprogressNotification: false,
ignoreUnverifiedSSLPeer: false,
includeBuildNumberInKey: false,
prependParentProjectKey: false,
projectKey: 'myproject',
repositoryKey: repository, // new argument as it's not clear how to get git url in workflow
stashServerBaseUrl: 'https://mybb.org'])
}
|
What for? StashBaseUrl + CommitSha1 should be enought to notify. |
How do we even derive the commit hash from pipelines? JENKINS-34455 gives a workaround using shell but pipelines don't expose a commit hash variable from what I can see, even though the job recognizes one. |
When building classic build steps, commit sha1 is known from the ENV. When using suggested git "https://mybb.org/project/${repository}.git" it could be obtained from workdir, i think |
@headcrabmeat, any idea when we can expect this feature? |
Is someone working on this issue? Is there a workaround? |
Workaround is proposed to pipeline plugin |
@tmds |
@headcrabmeat good to hear you are still on the issue! Depending on where you are it may be usefull to initiate a pull request and get some feedback even if things aren't working yet. |
@tmds, @scaytrase, |
@scaytrase can you review the PR? |
I think there is nothing to review until tests pass. Everything could change. I'm keeping eye on it, don't worry. The patch is full of temporary changes, I think @headcrabmeat let us know when he is ready |
@headcrabmeat the pipeline-examples has an example to get the commit sha: |
Not the best example, as for me. Very platform dependent, requires |
Only example so far and good as a starting point. |
Thanks guys, I was told that |
I implemented such a build step a few weeks ago for the gitlab-plugin. You can have a look at the GitLabCommitStatusStep as an example how to do this. |
Implemented with #115 |
I'd be great if we could use this plugin from a
Jenkinsfile
!The plugin repo has a compatibility guide.
The text was updated successfully, but these errors were encountered: