[Jenkins]소스 형상관리툴 환경셋팅(Linux)

Programing 2016.10.07 17:04 Posted by 애플자라

jenkins 홈페이지 http://jenkins-ci.org/ 들어가보면 우측에 자신의 os에 맞는 다운로드 페이지를 선택할 수 있다. Red Hat/Fedora/CentOS

그럼 rpm을 이용한 설치 가이드가 나온다. 이 가이드를 따라 다음의 command를 입력한다.

 

[root@NEWDEV install]# sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
--2016-10-07 17:00:39--  http://pkg.jenkins-ci.org/redhat/jenkins.repo
Resolving pkg.jenkins-ci.org... 52.202.51.185
Connecting to pkg.jenkins-ci.org|52.202.51.185|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 71
Saving to: “/etc/yum.repos.d/jenkins.repo”

100%[=========================================================================================================================================>] 71          --.-K/s   in 0s

2016-10-07 17:00:46 (6.34 MB/s) - “/etc/yum.repos.d/jenkins.repo” saved [71/71]

[root@NEWDEV install]# sudo rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
[root@NEWDEV install]# yum install jenkins
Loaded plugins: aliases, changelog, kabi, presto, product-id, refresh-packagekit, security, subscription-manager, tmprepo, verify, versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading support for Red Hat kernel ABI
Setting up Install Process
jenkins                                                                                                                                                     | 2.9 kB     00:00
jenkins/primary_db                                                                                                                                          |  87 kB     00:00
Resolving Dependencies
--> Running transaction check
---> Package jenkins.noarch 0:2.24-1.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================
 Package                                    Arch                                      Version                                     Repository                                  Size
===================================================================================================================================================================================
Installing:
 jenkins                                    noarch                                    2.24-1.1                                    jenkins                                     66 M

Transaction Summary
===================================================================================================================================================================================
Install       1 Package(s)

Total download size: 66 M
Installed size: 67 M
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 66 M
jenkins-2.24-1.1.noarch.rpm                                                                                                                                 |  66 MB     00:24
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
Lib_Utils2-1.00-07.noarch has missing requires of libcrypto.so.4()(64bit)
Lib_Utils2-1.00-07.noarch has missing requires of libssl.so.4()(64bit)
  Installing : jenkins-2.24-1.1.noarch                                                                                                                                         1/1
  Verifying  : jenkins-2.24-1.1.noarch                                                                                                                                         1/1

Installed:
  jenkins.noarch 0:2.24-1.1

Complete!

 

-------------------------------------------------------------------------------

 

[root@NEWDEV ~]# which java
/usr/bin/java


[root@NEWDEV ~]# java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (rhel-2.5.5.4.el6-x86_64 u79-b14)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

 

* JAVA_HOME 설정(없을 경우)
ln -s /usr/java/bin/java /usr/bin/java

 

[root@NEWDEV sysconfig]# pwd
/etc/sysconfig
[root@NEWDEV sysconfig]# vi jenkins

 

* 포트확인

 

## Type:        integer(0:65535)
## Default:     8080
## ServiceRestart: jenkins
#
# Port Jenkins is listening on.
# Set to -1 to disable
#
JENKINS_PORT="8080"

 

* jenkins service를 시작/중지/재시작 하는 방법

[root@NEWDEV ~]# sudo service jenkins start
Starting Jenkins                                           [  OK  ]

 

* 서비스 상태 확인

sudo chkconfig jenkins on

 

* 서비스 설치위치

/var/lib/jenkins

 

* 서비스 워크스페이스 위치

/var/lib/jenkins/jobs

 

* 서비스 로그 확인
/var/log/jenkins/jenkins.log


-------------------------------------------------------------------------------