File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ jenkins.war
13
13
nosetests.xml
14
14
coverage * /
15
15
.idea /
16
- bin /
17
16
include /
18
17
lib /
19
18
* .egg
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -eo pipefail
3
+
4
+ INPUT=/dev/stdin
5
+ if [ -t 0 ]; then
6
+ if [ " $# " -ne 1 ]; then
7
+ echo " ERROR: Illegal number of parameters."
8
+ echo " INFO: Use 'pipefail Jenkinsfile' or 'cat Jenkinsfile | pipefail'"
9
+ exit 1
10
+ fi
11
+ INPUT=$1
12
+ fi
13
+ # put credentials inside ~/.netrc
14
+ # define JENKINS_URL in your user profile
15
+ JENKINS_URL=${JENKINS_URL:- http:// localhost: 8080}
16
+
17
+ # failure to get crumb is ignored as this may be diabled on the server side
18
+ CRUMB=" -H ` curl -nfs " $JENKINS_URL /crumbIssuer/api/xml?xpath=concat(//crumbRequestField,%22:%22,//crumb)" ` " || CRUMB=' '
19
+
20
+ # The tee+grep trick assures that the exit code is 0 only if the server replied with "successfully validated"
21
+ curl -nfs -X POST $CRUMB -F " jenkinsfile=<-" $JENKINS_URL /pipeline-model-converter/validate < $INPUT \
22
+ | tee >( cat 1>&2 ) | grep ' successfully validated' > /dev/null
You can’t perform that action at this time.
0 commit comments