Skip to content

Instantly share code, notes, and snippets.

@mbruzek
Created August 11, 2017 15:07
Show Gist options
  • Save mbruzek/d7f758bc38425062f12121416495a038 to your computer and use it in GitHub Desktop.
Save mbruzek/d7f758bc38425062f12121416495a038 to your computer and use it in GitHub Desktop.
A script to kick off a parameterized build for Jenkins
#!/bin/bash
# Send a file to a Jenkins build using curl.
# The first parameter must be the URL of the Jenkins job to build.
# The second parameter must be the local file to send to Jenkins.
url=$1
local_file=$2
# curl $JENKINS_URL/job/$JOB_NAME/build -F file_key=@file_path -F json='{"parameter": [{"name": "param_name", "file": "file_key"}]}'
curl $url -F local_file=@${local_file} -F json='{"parameter": [{"name": "overcloudrc", "file": "local_file"}]}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment