Академический Документы
Профессиональный Документы
Культура Документы
Why Jenkins?
Benefits of Jenkins
Catch issues
faster
CI leads to CD
allowing you Everyone can
to deliver see what’s
software more happening
rapidly
Installing Jenkins
1. Go to URL : https://jenkins.io/download/
2. Downlaod Jenkins for Windows. We will use Jenkins Long Term Support(LTS) release.
3. Unzip the files. Double click on Jenkins installer
4. Follow the instruction as below screens
5. After click on ‘Finish’ button, your default browser will auto open with url –
http://localhost:8080/login?from=%2F displaying information of your Jenkins default
administrator password
6. Copy paste the password and click Continue button
7. Click on install suggested plugins
8. This will start downloading and installing default suggested plugins
9. Create first Admin user. This will be your first user created administrator account. So make sure
you keep your administrator user name and password some where safe so when you login next
time you know your administrator username and password.
10. Click on Save and Finish button
11. You have successful completed Jenkins installation!!!
12. Click on start using Jenkins
13. Open chrome browser and type following and hit enter
Localhost:8080
It will open Jenkins window and ask you to enter your username/password!!!
Manage Jenkins
Click on “Manage Jenkins”
Click on “Configure System”
You can configure work space root directory, Git specific settings and Email notification
Global Tool Configuration
Configure JDK, provide JDK name and its path. Also make sure you uncheck automatically
install new Java version
Configure Maven, Maven name and its path. Also make sure you uncheck automatically
install new Maven version
Similarly you can configure Ant, Git, Docker or any other tools
Configuring Jenkins Security
Click on “Manage Jenkins”
Click on “Configure Global Security”
Check enable security option
Access Control: Jenkin’s own user database
Authorization: Matrix based security
Jenkins Plugins management
Click on “Manage Jenkins”
Click on “Manage Plugins”
Plugins are the primary means of enhancing the functionality of a Jenkins environment to
suit organization- or user-specific needs. There are over a thousand different plugins which
can be installed on a Jenkins master and to integrate various build tools, cloud providers,
analysis tools, and much more.
Plugins can be automatically downloaded, with their dependencies, from the Update Center.
The Update Center is a service operated by the Jenkins project which provides an inventory of
open source plugins which have been developed and maintained by various members of the
Jenkins community.
What is GIT?
Git is a free and open source distributed version control system designed to handle everything
from small to very large projects with speed and efficiency
To track changes in files/folders
To collaborate in teams
Git stores the data in terms of “snapshots”. Snapshots is like a revision
When we comit in the GIT, it stores the data in terms of set of snapshots. Git only copy the files in
which changes are done
Git Workflow
GitHub
https://git-scm.com/downloads
Click on Windows (Download installer based on 32 bit or 64 bit Operating System)
Commands Description
git config --global user.name “[firstname set a name that is identifiable for credit when
lastname]” review version history
git config --global user.email “[valid-email]” set an email address that will be associated with
each history marker
git init initialize an existing directory as a Git repository
git clone [url] retrieve an entire repository from a hosted
location via URL
git status show modified files in working directory, staged
for your next commit
git add [file] add a file as it looks now to your next commit
(stage)
git reset [file] unstage a file while retaining the changes in
working directory
git commit -m “message…> Commit code in your local Git repository
git push [URL] [branch] Transmit local branch commits to the remote
repository branch
https://jenkins.io/solutions/java/
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
Create a profile in POM.xml file for batch execution of test cases using different testng.xml
file
<profiles>
<profile>
<id>Sanity</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>san_testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>