This blog post is available on Medium. Click here to see this story on Medium.
Jenkins is now popular these days as a continuous integration and continuous delivery tool to automate software development process to achieve DevOps objectives. I have a chance to see a demo during the Test-Driven Development training last week at IMC Institue by K.Somkiat Puisungnoen (www.somkiat.cc)
Jenkins is now popular these days as a continuous integration and continuous delivery tool to automate software development process to achieve DevOps objectives. I have a chance to see a demo during the Test-Driven Development training last week at IMC Institue by K.Somkiat Puisungnoen (www.somkiat.cc)
Here I have listed instructions I tried on Windows 10 that you can follow if you are new to Jenkins and want to see what it can do. Thank you very much to Nont who spent an hour to help me setting Jenkins up.
PS: I'm not the expert but just tried this out for the first time so your comments and suggestions will be very appreciated.
PS: I'm not the expert but just tried this out for the first time so your comments and suggestions will be very appreciated.
Instructions Summary
- Part I: Install Docker
- Part I: Clone repository from GitHub
- Part I: Download and start up Jenkins
- Part II: Add new project "PULLCODE" to connect to GitHub repository
- Part II: Add new project "BUILD" to build project with Maven
- Part II: Run MariaDB and test BUILD
- Part III: Install and create Build Pipeline
- Part III: Install JaCoCo to check for test coverage
- Part III: Install Build Monitor View and schedule run interval
1. Install Docker
- To avoid touching your Windows system, we will use Docker as a container for this demo.
- To learn about what Docker is. Click here.
- To download Docker for Windows. Click here.
- To learn how to install Docker on Windows. Click here.
- To learn how to get started with Docker. Click here.
After you have installed Docker, you may test it by typing this into Windows command line: docker version and you should see something like this:
2. Clone repository from GitHub
In this demo we will use an existing Maven project created by K'Somkiat on GitHub by cloning his repository (or my repository) to your GitHub account. To learn more about Git, see this blog.
Download Git Client from here and install it.
Note: If you don't want complication from installing MariaDB, you may use this repository instead.
Extract ZIP file to a folder and command prompt there (here is your working directory). Use command
git init
to create a new Git repository.Use command
git add .
to add files to Git staging area.Use command
git commit -m "Initial Commit"
to commit files to your Git repository.
Log in to your GitHub account (Sign up if you don't have an account) and create a new repository.
Give a name to your new repository and click Create.
Now you've got a blank repository. Please note your repository URL.
Go back to your command prompt and use command
Then use command
Now, if you go back to your GitHub you should see files in your own repository like this:
If you want to install locally without using Docker, you can download the war file here. You can find the older version by the link below.
Once your pull is done, use command docker images then you should see the image is now available on your local.
Start up a new Jenkins container by using command docker run -d --name jenkinsdemo -p 8080:8080 jenkins:1.651.3
If you install Jenkins locally you can start it up by using command java -jar "jenkins v1.651.3.war"
Check your container's log by command docker logs jenkinsdemo and look for the line:
This tells your Jenkins is ready to use.
Open Jenkins with web browser at http://localhost:8080/ and you should see the dashboard like this.
Continue in Part II...
Give a name to your new repository and click Create.
Now you've got a blank repository. Please note your repository URL.
Go back to your command prompt and use command
git remote add origin <your Git repository URL>
git push --set-upstream origin master
to push files to your Git repository on GitHub.Now, if you go back to your GitHub you should see files in your own repository like this:
3. Download and Start up Jenkins
Use command docker pull jenkins:1.651.3 to download Jenkins Docker image version 1.651.3 (You may use the newer or latest version but I'll use this version which I'm familiar with).If you want to install locally without using Docker, you can download the war file here. You can find the older version by the link below.
Once your pull is done, use command docker images then you should see the image is now available on your local.
Start up a new Jenkins container by using command docker run -d --name jenkinsdemo -p 8080:8080 jenkins:1.651.3
If you install Jenkins locally you can start it up by using command java -jar "jenkins v1.651.3.war"
Check your container's log by command docker logs jenkinsdemo and look for the line:
This tells your Jenkins is ready to use.
Open Jenkins with web browser at http://localhost:8080/ and you should see the dashboard like this.
Continue in Part II...
Updated section 2 to download and create new repository using git command lines instead of cloning repository.
ReplyDeleteAdd link to my blog about Git (http://www.pacroy.com/2017/01/learn-git-within-7-minutes-and-play.html) in the section 2
ReplyDeleteAdd alternative repository https://github.com/pacroy/demo-jenkins in section 2. This one does not require MariaDB.
ReplyDeleteReplaced console commands and outputs with Gist
ReplyDeleteHi, you have given really informative post. Thanks for sharing this post to our vision.
ReplyDeleteOracle Training in Chennai | Certification | Online Training Course | Oracle Training in Bangalore | Certification | Online Training Course | Oracle Training in Hyderabad | Certification | Online Training Course | Oracle Training in Online | Oracle Certification Online Training Course | Hadoop Training in Chennai | Certification | Big Data Online Training Course
the article is very much useful DevOps Training in Bangalore | Certification | Online Training Course institute | DevOps Training in Hyderabad | Certification | Online Training Course institute | DevOps Training in Coimbatore | Certification | Online Training Course institute | DevOps Online Training | Certification | Devops Training Online
ReplyDelete