Skip to content

Commit

Permalink
Adding sandbox jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Aug 10, 2017
1 parent cc155d4 commit 88bcc88
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Generic Webhook Plugin Changelog
Changelog of Generic Webhook Plugin.
## Unreleased
## 1.18 (2017-08-10 18:13:06)
### GitHub [#18](https://github.com/jenkinsci/generic-webhook-trigger-plugin/issues/18) How to access request header variables?

**Correcting name/descriptions #18**


[2643526ce361183](https://github.com/jenkinsci/generic-webhook-trigger-plugin/commit/2643526ce361183) Tomas Bjerre *2017-08-10 18:12:12*


### No issue

**doc**
Expand Down
23 changes: 23 additions & 0 deletions sandbox/sandbox.jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* curl -X POST -H "Content-Type: application/json" -d '{ "before": "1848f12", "after": "5cab1", "ref": "refs/heads/develop" }' -vs http://admin:admin@localhost:8080/jenkins/generic-webhook-trigger/invoke
*/
node {
properties([
pipelineTriggers([
[$class: 'GenericTrigger',
genericVariables: [
[expressionType: 'JSONPath', key: 'reference', value: '$.ref'],
[expressionType: 'JSONPath', key: 'before', value: '$.before']
],
regexpFilterText: '$reference',
regexpFilterExpression: ${env.JOB_NAME}.split("/")[1]
]
])
])

stage("build") {
sh '''
echo Build $reference before $before
'''
}
}

0 comments on commit 88bcc88

Please sign in to comment.