Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active December 28, 2015 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garystafford/7424523 to your computer and use it in GitHub Desktop.
Save garystafford/7424523 to your computer and use it in GitHub Desktop.
From part 2 of my blog post, 'Building a Deployment Pipeline Using Git, Maven, Jenkins, and GlassFish (Part 2 of 2)'
#!/bin/sh
# Call Jenkins to start build and pass environment parameter
#
echo "executing post-receive hook"
echo "environment=testing"
echo "user=jenkins"
# cURL POST request using jenkins user with API token
curl -u jenkins:{your-api-token-here} \
--data "delay=0sec&environment=testing" \
"{your-jenkins-server-url:port}/job/GitMavenGlassFish_Build/buildWithParameters"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment