I am working with a Jenkins build server to run synthesis/simulation for FPGAs. Right now I have nightly builds and can start the build manually in Jenkins browser interface
I've googled across many addresses and the working result can be found here:
#!/bin/bash
TOKEN='jenkins-user-token'
USER='my-username'
SERVER="http://your.server.address"
#jenkins job parameters
PARAMF=$1
SECONDPARAM=$2
# retrieve the crumb that we need to pass in the header
CRUMBS=$(curl -s -X GET -u $USER:$TOKEN ${SERVER}/crumbIssuer/api/json | jq -c '. | .crumb ')
curl --user $USER:$TOKEN -H "Jenkins-Crumb:${CRUMBS}" -X POST "${SERVER}/view/MyView/job/JobName/buildWithParameters?TOKEN=${TOKEN}&PARAMETERONE=${PARAMF}&PARAMETERTWO=${SECONDPARAM}"
The steps script does:
you can save this script as jenkins-job-cli.sh and call it
chmod +x jenkins-job-cli.sh
./jenkins-job-cli.sh first-parameter second-parameter
Hope this help.
Cheers,
Leslie