"jenkins"에 해당되는 글 1건

  1. 2019/07/11 CentOS 7.4에서 Jenkins 설치하기

CentOS 7.4에서 Jenkins 설치하기

2019/07/11 14:46
1. JDK && Git Client 설치
yum install java-1.8*
java -version
yum install git
git --version
2. 방화벽 설정
yum list installed | grep firewalld
설치되어 있지 않을 경우,
yum install -y firewalld

<서비스 등록>
systemctl unmask firewalld
systemctl enable firewalld
systemctl start firewalld

<방화벽 등록>
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --permanent --zone=public --add-port=8080/tcp
firewall-cmd --reload
3. Maven / Gradle 설치
mkdir /tools
cd /tools

<Maven Download>
wget http://mirror.navercorp.com/apache/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
tar xzvf apache-maven-3.6.1-bin.tar.gz
ln -s apache-maven-3.6.1 maven

<Maven ENV Setting>
vi /etc/profile.d/maven.sh

export MAVEN_HOME=/tools/maven
export PATH=${MAVEN_HOME}/bin:${PATH}

source /etc/profile.d/maven.sh
mvn -version

<Gradle Download>
wget --no-check-certificate https://services.gradle.org/distributions/gradle-5.4.1-bin.zip
unzip gradle-5.4.1-bin.zip
ln -s gradle-5.4.1 gradle

<Gradle ENV Setting>
vi /etc/profile.d/gradle.sh

export GRADLE_HOME=/tools/gradle
export PATH=${GRADLE_HOME}/bin:${PATH}

source /etc/profile.d/gradle.sh
gradle -v
4. Jenkins 설치
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key
yum install -y jenkins

<Jenkins Default Port Setting>
vi /etc/sysconfig/jenkins
JENKINS_PORT="8080"

<Jenkins Operation>
Start : service jenkins start
Stop : service jenkins stop
Restart : service jenkins restart
5. Jenkins 실행
Web Browser에서 http://localhost:8080 접속

<Initial Admin Password>
view /var/lib/jenkins/secrets/initialAdminPassword

<Error Case>
Admin 로그인 후, This Jenkins instance appears to be offline 일 경우,

vi /var/lib/jenkins/hudson.model.UpdateCenter.xml
<url>https://updates.jenkins.io/update-center.json</url> 에서 https -> http로 변경

<Jenkins Restart>
service jenkins restart