Jenkins

[Mobile version(QRCode)]
Access record[Graph / PV Info.(Past 1 day / Past 1 week) / Access from outside (Yesterday / Past 1 week) / Vistors's list]
ProfilePmail(Mail)
Inbox   /Send   /Sent
Reviews(List   /Limit)
Poll   /Agree:Got   /Sent
Fan
Works/Music
Blog
[Write]
Links
My Play List
 Created dateCategoryArticle title
12016/08/02JenkinsPipeline
22016/02/11JenkinsHow to install Jenkins for..
 Created dateNameRecent messages

1.
2016/08/02 No.2 "Jenkins > Pipeline"
[Show only this article / Modify / Delete / Send trackback / Add to the shared category]



RequirementConfluence
TaskJenkins
CommitBitbucket
CheckoutJenkins
BuildJenkins
Smoke testJenkins
Unit testJenkins
Integration testJenkins
Code qualityJenkins
ReportJenkins

Deploy to production
JenkinsDeploy
JenkinsIntegration test for production


Add comment to this article

2.
2016/02/11 "Jenkins > How to install Jenkins for continous integration and deployment using bitbucket"
[Show only this article / Modify / Delete / Send trackback / Add to the shared category]

1. Why do you use Jenkins for Continuous integration and delivery?
2. Install Jenkins
3. Set up initial security for Jenkins
4. Manage plug-in
5. Set up for integration with Bitbucket
6. Create job which will be triggered by push to bitbucket

1. Why do you use Jenkins for Continuous integration and delivery?

Cloud service is easy but they have the limitation of programming language and they will cost some price.
If you are not happy to use cloud service, then let's install Jenkins by yourself.
Down side is the cost of your operation and upper side is the flexibility of the environment.
2. Install Jenkins

The procedure is quite easy.

In the case of Ubuntu:
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu

Install
wget -q -O - https://jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins
sudo apt-get install git

Upgrade
sudo apt-get update
sudo apt-get install jenkins

In the case of Redhat (CentOS):
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Red+Hat+distributions

sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
sudo yum install jenkins
sudo yum install java

sudo chkconfig jenkins on
sudo /etc/init.d/jenkins start

Now you can access to Jekins through the port 8080.

http://SERVER-NAME:8080/
3. Set up initial security for Jenkins

Manage Jenkins => Setting of Global security

Check check box of enabling security
Check radio button of user database of Jenkins
Check check box of allowing users to sign up

Go to screen for logging in and sign up

Manage Jenkins => Setting of Global security

Disable sign up function.

Check radio button of administration by line-column

Add user accounts and check check box of privileges. If the account is the first one, you should give all privileges.

Log out and log in again to confirm that the system is working correctly.
4. Manage plug-in

Manage Jenkins => Manage plug-in

Install Bitbucket plugin with restarting

Update installed plugin.

Restart Jenkins
5. Set up for integration with Bitbucket

sudo su - jekins
ssh-keygen

If you cannot log in as jenkins, check /etc/passwd and /bin/bash is specified as a shell.
If not, modify the part.

Register /var/lib/jenkins/.ssh/id_rsa in the ssh setting of bitbucket

As jenkins user

vi ~/.ssh/config
Host bitbucket.org
port 22
Hostname bitbucket.org
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
IdentitiesOnly yes
chmod 600 ~/.ssh/config

Confirm the setting
ssh -T git@bitbucket.org

Go to the project page of bitbucket
Setting => Webhook => Add webhook

Set the url
http://JENKINS-SERVER:8080/git/notifyCommit?url=git@bitbucket.org:USER-NAME/REPO-NAME.git
6. Create job which will be triggered by push to bitbucket

Create new job

- Choose git
Set git@bitbucket.org:user_name/REPO-NAME.git in Repository URL

- Choose bitbucketweb in repository browser
Set https://USER-NAME@bitbucket.org/USER-NAME/REPO-NAME.git in URL

- Check Polling SCM in Build trigger

- Build => Add the procedure of build -> Execute Shell => Write some shell script

Then commit and push to bitbucket.
The job will be triggered by push.

Git files will be cloned under
/var/lib/jenkins/workspace/$PJNAME

So you can do anything from here.
You can define the procedure of continuous integration or delivery from here.

Add comment to this article
Subscribe to RSS
RSS
Display Style of blog
List/Mobile(QRCode)
Term
Category
All
1.Japan
2.Atlassian's products
3.Self
4.Development of this site
5.Japanese comics
6.Japanese anime
7.Weekly hot news of Japanese culture
8.OP/ED/PV
9.Japanese game
10.Ranking
11.Japanese Comics (Manga)
12.Search Engine
13.Japanese drama
14.Japanese otaku culture
15.Programming
16.Ineternet world
17.Movie
18.C/C++
19.BerkeleyDB
20.Apache programming
21.Spam
22.Meteor
23.Marketing
24.Python
25.Scrum
26.JIRA
27.Git
28.CI
29Jenkins
30.AWS
31.Operation
32.Singapore
33.Cloud
34.Mysql Cluster
35.DevOps
36.Bitbucket
37.Xamarin
38.Good and new
39.Monitoring
40.JavaScript(node.js)
41.React
42.Phillipines
43.Hiring
44.Python
45.SEO
46.Malaysia
47.Mongodb
48.Perl
49.Docker
50.Life hack
51.Dance
52.QA
53.Mysql
54.Digital Life Hack
Sayings from S-Cry-Ed

Rule in this world is speed. Even stupid person can write cool novel if he can spend 20 years for it.

If someone helped me, I will help him in return, which is my rule.

To become stronger, consider what is cowardliest thinking. And rebel against the thinking, which will make you stronger.



I am Japanese but working for some English sites.

Doctor Job Career
Nurse Job Career
Top Page top MetaSeachJP Works