Running Jenkins under docker container & using jenkins CMD line

INSTALLING DOCKER

INSTALLING JENKINS MASTER AS DOCKER CONTAINER

COMMAND

  • Command to run docker
  • Command to check whether docker started or not
    • docker ps –a

Configuring CLI Jenkins

Jenkins has a built-in command line interface that allows you to access Jenkins from a script or from your shell. This is convenient for automation of routine tasks, bulk updates, trouble diagnosis, and so on.

This interface is accessed via the Jenkins CLI client, which is a Java JAR file distributed with Jenkins.

  • command to download Jenkins-cli.jar file
  • Setting JENKINS_URL variable
  • Setting Jenkins-cli as alias for running Jenkins-cli.jar
    • echo “alias jenkins-cli=’java -jar /var/lib/jenkins/jenkins-cli.jar'” >> ~/.bashrc
  • Authenticate the jenkins
  • Command to install plugin from CLI
    • jenkins-cli install-plugin thinBackup –restart
    • jenkins-cli -auth @jenkinsauth build FOLDER1/Coberutra-Examp
    • jenkins-cli -auth @jenkinsauth list-jobsle

Leave a Reply