Use this file to discover all available pages before exploring further.
In this tutorial, you’ll learn how to fetch, modify, and update a Freestyle job (npm-version-test) on Jenkins using the Jenkins CLI. The job prints the installed Node.js and npm versions. We’ll download its XML configuration, adjust the build steps, and push the changes back.
echo "Updating job config using Jenkins CLI"node -vnpm -v
Trigger a new build. The console log should display something like:
Started by user siddharthBuilding on the built-in node in workspace /var/lib/jenkins/workspace/npm-version-test+ echo Updating job config using Jenkins CLIUpdating job config using Jenkins CLI+ node -vv22.6.0+ npm -v10.8.2Finished: SUCCESS
That’s it! You’ve successfully edited a Freestyle job’s configuration and updated it in Jenkins using the CLI.