Created
September 4, 2013 08:34
-
-
Save mfriedenhagen/6434313 to your computer and use it in GitHub Desktop.
Small shell script which will read the GIT scm connection and ciManagement URL from a POM and trigger the poll of jobs in a Jenkins instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Small shell script which will read the GIT scm connection and ciManagement URL | |
# from a POM and trigger the poll of jobs in a Jenkins instance. | |
# SED-Voodoo via http://www.grymoire.com/Unix/Sed.html | |
# | |
# Note that you have do run this once online to get all needed dependencies for | |
# help plugin. Afterwards you may invoke this with "--offline" or "-o" for speed. | |
GOAL="org.apache.maven.plugins:maven-help-plugin:2.2:evaluate" | |
BASEURL="`mvn $@ $GOAL -Dexpression=project.ciManagement.url | sed -n '\,/job/, s,\(.*\)\/job\/.*,\1/git/notifyCommit?url=,p'`" | |
CONNECTION="`mvn $@ $GOAL -Dexpression=project.scm.connection | sed -n '/^scm:git/ s/scm:git://p'`" | |
URL="${BASEURL}${CONNECTION}" | |
echo "notifyURL=${URL}" | |
curl --netrc --head ${URL} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment