Run a Jenkins job



  • Thanks to @muvvala-g for this idea.

    1. Download the jenkins-cli.jar file with this command:
    wget http://localhost:8080/jnlpJars/jenkins-cli.jar
    
    1. Setup a TRIGGERcmd command that runs your Jenkins job with a command like this:
    java -jar jenkins-cli.jar -s http://localhost:8080 -http -auth admin:PASSWORD build MyJob -v -s
    

    If your Jenkins server uses HTTPS, then change the URL accordingly, and remove the -http parameter.

    Using TRIGGERcmd for this is more secure than this approach because there's no need for an in-bound port on your firewall pointing to your Jenkins server.


Log in to reply