897 B
897 B
Exercise 9
This exercise explores the use of the REST API to trigger a build for an existing job. You will configure security features as necessary.
Using the REST API for Common Operations
- Create a new user named
buildbot. - Add adminstration permissions for the user.
- Log in with user
buildbot. - Generate the API token for the user.
- Generate a Jenkins crumb from the command line.
- Export the environment variables
JENKINS_CRUMBandJENKINS_API_TOKENwith the correct values. - Trigger a build of the job
gradle-initializrwith acurlcommand using the REST API. - Disable the job
gradle-initializrwith acurlcommand using the REST API. - Reenable the job
gradle-initializrwith acurlcommand using the REST API. - Download the Jenkins CLI client.
- Trigger the build of the job
gradle-initializrwith acurlcommand using the Jenkins CLI.