Rapid-fire: how do you trigger a Jenkins job remotely with parameters?
IntermediateProductionRapid-Fire Commands
Answer
curl -X POST -u "$USER:$API_TOKEN" \
"https://jenkins.example.com/job/deploy-app/buildWithParameters" \
--data-urlencode "ENV=staging" --data-urlencode "VERSION=1.7.0"
java -jar jenkins-cli.jar -s https://jenkins.example.com -auth "$USER:$API_TOKEN" \
build deploy-app -p ENV=staging -s -v
Use an API token, not a password, and include the crumb if your Jenkins requires it with token-less sessions.
More on Rapid-Fire Commands
Rapid-fire: how do you trigger a GitHub Actions workflow from the CLI and watch it?BeginnerRapid-fire: how do you list and manage GitHub secrets and variables via CLI?BeginnerRapid-fire: how do you validate a GitHub Actions workflow locally?BeginnerRapid-fire: how do you validate a `.gitlab-ci.yml` and trigger a pipeline from the CLI?BeginnerRapid-fire: how do you validate a Declarative Jenkinsfile from the command line?IntermediateRapid-fire: how do you install pinned Jenkins plugins and list installed ones?Intermediate