1.1.1. Installing Jenkins
Download jenkins.war from http://www.jenkins-ci.org. Now open a terminal and execute java –jar jenkins.war. This will initiate Jenkins in port 8080 by default (if you need to change that port, use — httpPort=9999). Jenkins creates a default workspace for you at ~/.jenkins or it uses the folder specified in JENKINS_HOME environment variable.
Note: – In our project port no is 8080.
On the RedHat Linux you can install from repository by follow following steps:-
To use this repository, run the following commands:-
# sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
#yum install Jenkins
- service jenkins start/stop/restart
· Jenkins will be launched as a daemon up on start. See /etc/init.d/jenkins for more details.
· The ‘jenkins’ user is created to run this service. If you change this to a different user via the config file, you must change the owner of /var/log/jenkins, /var/lib/jenkins, and /var/cache/jenkins.
· Log file will be placed in /var/log/jenkins/jenkins.log. Check this file if you are troubleshooting Jenkins.
· /etc/sysconfig/jenkins will capture configuration parameters for the launch.
· By default, Jenkins listen on port 8080. Access this port with your browser to start configuration.
Go to http://localhost:8080 to check if your installation is working. We will call this page as main screen from now on.
- Manage Jenkins > Manage Nodes.
- New Node –> Enter Node Name.
- Select Dumb Slave –> Press OK.
- Fill out the following:
- Set a number of executors (one or more) as needed.
- Set a Remote FS Root, a home directory for the master on the slave machine.
- For a Windows slave, use something like: “C:\Jenkins\”
- TODO: add details.
- Select the appropriate Usage setting:
- For an additional worker: Utilize this slave as much as possible
- For specialized jobs: Leave this machine for tied jobs only
- Launch Method:
- An easy way to control a Windows slave is by using Launch slave agents via Java Web Start (Recommended for Windows)
- TODO: add steps for other methods.
- Availability –> Keep this slave online as much as possible
- TODO: add details for each option.
- Press OK.
- Now you need to connect your slave machine to the master using the following steps.
- On you slave machine go to the Jenkins server url.
- Go to Manage Jenkins > Manage Nodes, Click on the newly created slave machine.
- Click on the Launch button to launch agent from browser on slave.
- Run the program.
5. Now you should see the Slave machine connected under Nodes.
- If you want the service to run on start-up of the slave machine do the following (Windows only directions):
- In the Slave agent program running on your slave machine, click File –> Install as Windows Service.
- Start, type Services and Select the Services program.
- Find Jenkins Slave in the list, Double click to open.
- Select Startup type –> Automatic.
- Go to the Log On tab, change the Log on as to a user of your choice (Special user account Jenkins recommended).
- Make sure that auto login is set for the slave machine for the user account, then the VM (or physical computer) should connect and be available when needed.