티스토리 뷰

반응형

 

 

 

 

 

 

리눅스에 dnf 명령어로 jenkins를 설치해보고자 한다.

 

 

리눅스 젠킨스 설치순서는 아래와 같이 진행하면 무탈하다
  1. Java 11 이상 설치
  2. Jenkins GPG Key 설치
    rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
  3. Jenkins repo 등록
    dnf config-manager --add-repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
  4. dnf install jenkins
  5. systemctl start jenkins

 

 

 

 

 

먼저 java가 설치되어 있어야 하므로 java를 먼저 설치해준다.
11 버전 이상을 설치해줘야 된다.  8버전 설치하면 jenkins 구동 안됨.

[root@cb6f01f0a4ec /]# dnf install java-11-openjdk.x86_64
Last metadata expiration check: 1:17:32 ago on Mon Aug 28 23:48:44 2023.
Dependencies resolved.
=====================================================================================================================
 Package                              Architecture      Version                           Repository            Size
=====================================================================================================================
Installing:
 java-11-openjdk                      x86_64            1:11.0.20.0.8-3.el8_8             appstream            472 k

 

 

 

 

이제 젠킨스를 설치하면 되는데

설치전에 사전 작업들이 필요하다. (jenkins repo 등록하고 GPG key를 설치해야 한다.)

일단 사전 작업을 하지 않았을때 어떤 메세지가 나오는지 봐보자.

 

사전작업 없이 jenkins install 명령어 입력했을때,

아래와 같이 찾을 수 없다고 뜸.

[root@cb6f01f0a4ec ~]# dnf install jenkins
Last metadata expiration check: 0:02:37 ago on Mon Aug 28 23:42:48 2023.
No match for argument: jenkins
Error: Unable to find a match: jenkins

 

 

jenkins repo 를 등록해줘야 하는데

아래와 같은 에러가 날 수도 있다.

[root@cb6f01f0a4ec ~]# dnf config-manager --add-repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
No such command: config-manager. Please use /usr/bin/dnf --help
It could be a DNF plugin command, try: "dnf install 'dnf-command(config-manager)'"

 

 

dnf-command(config-manager) 플러그인을 설치하라고 그런다.

설치해주자

[root@cb6f01f0a4ec ~]# dnf install 'dnf-command(config-manager)'
Last metadata expiration check: 0:01:09 ago on Mon Aug 28 23:46:41 2023.
Dependencies resolved.
===========================================================================================================
 Package                             Architecture      Version                     Repository         Size
===========================================================================================================
Installing:
 dnf-plugins-core                    noarch            4.0.21-19.el8_8             baseos             74 k

 

 

 

 

그런 다음 다시 jenkins repo 를 등록해주면 잘 등록되는 것을 확인 할 수 있다.

[root@cb6f01f0a4ec ~]# dnf config-manager --add-repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
Adding repo from: https://pkg.jenkins.io/redhat-stable/jenkins.repo

 

 

 

 

 

 

GPG key 를 설치하지 않고 jenkins를 install 하면 아래와 같이 메세지가 뜬다.

[root@cb6f01f0a4ec ~]# dnf install jenkins
Last metadata expiration check: 0:06:32 ago on Mon Aug 28 23:48:44 2023.
Dependencies resolved.
===========================================================================================================
 Package                  Architecture          Version                       Repository              Size
===========================================================================================================
Installing:
 jenkins                  noarch                2.414.1-1.1                   jenkins                 85 M
Installing dependencies:
 procps-ng                x86_64                3.3.15-13.el8                 baseos                 329 k

Transaction Summary
===========================================================================================================
Install  2 Packages

Total download size: 86 M
Installed size: 86 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): procps-ng-3.3.15-13.el8.x86_64.rpm                                  791 kB/s | 329 kB     00:00
(2/2): jenkins-2.414.1-1.1.noarch.rpm                                      1.2 MB/s |  85 MB     01:13
-----------------------------------------------------------------------------------------------------------
Total                                                                      1.2 MB/s |  86 MB     01:14
Public key for jenkins-2.414.1-1.1.noarch.rpm is not installed
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: GPG check FAILED

 

 

GPG key 를 설치해주고 패키지를 clean 한뒤 다시 젠킨스를 설치해주자

[root@cb6f01f0a4ec ~]# rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
[root@cb6f01f0a4ec ~]# dnf clean packages
2 files removed

 

 

 

 

 

 

젠킨스 설치 완료!

[root@cb6f01f0a4ec ~]# dnf install jenkins
Last metadata expiration check: 0:09:42 ago on Mon Aug 28 23:48:44 2023.
Dependencies resolved.
===========================================================================================================
 Package                  Architecture          Version                       Repository              Size
===========================================================================================================
Installing:
 jenkins                  noarch                2.414.1-1.1                   jenkins                 85 M
Installing dependencies:
 procps-ng                x86_64                3.3.15-13.el8                 baseos                 329 k

Transaction Summary
===========================================================================================================
Install  2 Packages

Total download size: 86 M
Installed size: 86 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): procps-ng-3.3.15-13.el8.x86_64.rpm                                  845 kB/s | 329 kB     00:00
(2/2): jenkins-2.414.1-1.1.noarch.rpm                                      1.3 MB/s |  85 MB     01:04
-----------------------------------------------------------------------------------------------------------
Total                                                                      1.3 MB/s |  86 MB     01:05
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                   1/1
  Installing       : procps-ng-3.3.15-13.el8.x86_64                                                    1/2
  Running scriptlet: jenkins-2.414.1-1.1.noarch                                                        2/2
  Installing       : jenkins-2.414.1-1.1.noarch                                                        2/2
  Running scriptlet: jenkins-2.414.1-1.1.noarch                                                        2/2
  Verifying        : procps-ng-3.3.15-13.el8.x86_64                                                    1/2
  Verifying        : jenkins-2.414.1-1.1.noarch                                                        2/2

Installed:
  jenkins-2.414.1-1.1.noarch                         procps-ng-3.3.15-13.el8.x86_64

Complete!

 

 

 

 

젠킨스를 구동시키면 잘 되는 것을 알 수 있다.

[root@cb6f01f0a4ec ~]# systemctl start jenkins
[root@cb6f01f0a4ec ~]# systemctl status jenkins
● jenkins.service - Jenkins Continuous Integration Server
   Loaded: loaded (/usr/lib/systemd/system/jenkins.service; disabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/jenkins.service.d
           └─override.conf
   Active: active (running) since Tue 2023-08-29 01:33:22 UTC; 4s ago
 Main PID: 93 (java)
    Tasks: 37 (limit: 9450)
   Memory: 223.1M
   CGroup: /system.slice/jenkins.service
           └─93 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/java/jenkins.war --webroot=/var/cache/jenkins>

Aug 29 01:33:05 cb6f01f0a4ec jenkins[93]: This may also be found at: /var/lib/jenkins/secrets/initialAdminPassword
Aug 29 01:33:05 cb6f01f0a4ec jenkins[93]: *************************************************************
Aug 29 01:33:05 cb6f01f0a4ec jenkins[93]: WARNING: An illegal reflective access operation has occurred
Aug 29 01:33:05 cb6f01f0a4ec jenkins[93]: WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java>
Aug 29 01:33:05 cb6f01f0a4ec jenkins[93]: WARNING: Please consider reporting this to the maintainers of org.codehaus>
Aug 29 01:33:05 cb6f01f0a4ec jenkins[93]: WARNING: Use --illegal-access=warn to enable warnings of further illegal r>
Aug 29 01:33:05 cb6f01f0a4ec jenkins[93]: WARNING: All illegal access operations will be denied in a future release
Aug 29 01:33:22 cb6f01f0a4ec jenkins[93]: 2023-08-29 01:33:22.543+0000 [id=29]        INFO        jenkins.InitReacto>
Aug 29 01:33:22 cb6f01f0a4ec jenkins[93]: 2023-08-29 01:33:22.570+0000 [id=22]        INFO        hudson.lifecycle.L>
Aug 29 01:33:22 cb6f01f0a4ec systemd[1]: Started Jenkins Continuous Integration Server.

 

기본 포트는 8080으로 되어있으니 변경 후 사용할 것!

 

 

설정 변경은

/usr/lib/systemd/system/jenkins.service  파일을 vi로 열어 수정할 것!

 

 

 

 

 


 

젠킨스를 리눅스에서 버전 업데이트 하시는 방법은 아래와 같습니다.

 

 

[Jenkins] 젠킨스 버전 업데이트하기 (feat.rockylinux)

 

[Jenkins] 젠킨스 버전 업데이트하기 (feat.rockylinux)

젠킨스 버전이 수시로 나오므로 버전 차이가 너무 나지 않게 적당한 수준에서 업데이트 해주는 것이 좋겠다. 젠킨스가 설치되지 않았다면 아래 설치 포스트를 참고하여 설치하시길 바랍니다. [J

jong-bae.tistory.com

 

 

 

 

728x90
반응형
댓글
최근에 올라온 글
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Total
Today
Yesterday