IT/DevOps

[DevOps] Nexus ์‹คํ–‰ ๋ฐ ์—ฐ๋™ (feat. eGovCI)

์–ดํฅ๊ผฌ๋น„ 2024. 5. 8.

์ „์ž์ •๋ถ€ํ”„๋ ˆ์ž„์›Œํฌ์˜ ์„œ๋ฒ„์šฉ ๊ฐœ๋ฐœํ™˜๊ฒฝ์— ๋“ค์–ด ์žˆ๋Š” Nexus๋ฅผ ์„ค์น˜ ๋ฐ ์—ฐ๋™ ๊ณผ์ •์„ ๊ธฐ๋กํ•œ๋‹ค.

 

[DevOps] CentOS 8 Jenkins CI, CD ํ™˜๊ฒฝ ๊ตฌ์ถ•(feat. eGovCI)

๋ชฉ์ฐจ์ด๋ฒˆ์—” ์ „์ž์ •๋ถ€ํ”„๋ ˆ์ž„์›Œํฌ์˜ ์„œ๋ฒ„์šฉ ๊ฐœ๋ฐœํ™˜๊ฒฝ์„ ์ด์šฉํ•ด์„œ CI, CD๋ฅผ ๊ตฌ์ถ•ํ–ˆ๋‹ค.๋‹ค์Œ์—” ์ €๋ฒˆ์— ์„ค์น˜ํ•œ GitLab๊ณผ ์ƒˆ๋กœ ์„ค์น˜ํ•œ Jenkins๋กœ ์ฒ˜์Œ๋ถ€ํ„ฐ ์—ฐ๋™ํ•˜๋Š” ๊ฒƒ๋„ ํฌ์ŠคํŒ… ์˜ˆ์ •์ด๋‹ค. [DevOps] CentOS 8 Jen

yaga.tistory.com


Nexus ์‹คํ–‰ ๋ฐ ์„ค์ •

eGovCI-4.2.0์„ ๊ธฐ์ค€์œผ๋กœ ์ž‘์„ฑ๋˜์—ˆ๋‹ค.

ํ•ด๋‹น ๋ฒ„์ „์˜ Nexus OSS ๋ฒ„์ „์€ 2.15.1์ด๋ผ jdk 1.8์ด ํ•„์ˆ˜๋‹ค.

ํ•ด์„œ nexus ์‹คํ–‰ ์‹œ์—๋Š” ๋”ฐ๋กœ jdk 1.8๋กœ ๋Œ๋ ค์•ผ ํ•œ๋‹ค.

jdk 1.8 ๋ฆฌ๋ˆ…์Šค์šฉ์„ ํ•ด๋‹น ๊ฒฝ๋กœ์— ์—…๋กœ๋“œ ํ›„ ์„ค์ •ํŒŒ์ผ์—์„œ ์„ค์ •ํ•œ๋‹ค.

vi ~/eGovCI-4.2.0/bin/nexus-2.15.1-02-bundle/nexus-2.15.1-02/bin/jsw/conf/wrapper.conf

Nexus์˜ ํฌํŠธ๊ฐ€ WAS์˜ ํฌํŠธ์™€ ์ค‘๋ณต๋˜์ง€ ์•Š๋„๋ก ํฌํŠธ๋„ ๋ณ€๊ฒฝํ•œ๋‹ค.

vi ~/eGovCI-4.2.0/bin/nexus-2.15.1-02-bundle/nexus-2.15.1-02/conf/nexus.properties

Nexus๋ฅผ ๋ฐฑ๊ทธ๋ผ์šด๋“œ๋กœ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด ์‹œ์ž‘ ์‰˜ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‚ด์ง ์ˆ˜์ •ํ•œ๋‹ค.

vi ~/eGovCI-4.2.0/start-nexus.sh

eGovCI-4.2.0์˜ start-nexus.sh๋ฅผ ์‹คํ–‰ํ•œ๋‹ค.

์ด ๋•Œ nexus์™€ ์—ฐ๋™๋œ jdk ๋ฒ„์ „์ด 1.8์ด ์•„๋‹ ๊ฒฝ์šฐ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค.

๋ธŒ๋ผ์šฐ์ €์—์„œ ์„œ๋ฒ„์•„์ดํ”ผ:8082/nexus๋กœ url ํ˜ธ์ถœ ์‹œ ํ™”๋ฉด์ด ํ‘œ์‹œ๋˜๋Š”์ง€ ํ™•์ธ ํ›„ admin/admin123์œผ๋กœ ๋กœ๊ทธ์ธ ํ›„ ๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ๋ณ€๊ฒฝํ•œ๋‹ค.

Views/Repositories๋ฅผ ์„ ํƒํ•œ๋‹ค.

3rd party > ์•„๋ž˜ ๋ฉ”๋‰ด์—์„œ Artifact Upload > GAV Parameters๋ฅผ ์„ ํƒ ํ›„ Group, Artifact, Version์ž…๋ ฅ ํ›„ Packaging์„ jar๋กœ ์„ ํƒํ•œ๋‹ค

Select Artifact(s) for Upload์˜์—ญ > Select Artifact(s) to Upload ์„ ํƒ ํ›„ ์—…๋กœ๋“œ ํ•  jarํŒŒ์ผ์„ ์„ ํƒ ํ›„ Upload Artifact(s)๋กœ ์—…๋กœ๋“œ ํ•œ๋‹ค.

ํŽ˜์ด์ง€ ์ƒˆ๋กœ๊ณ ์นจ ๋˜๋Š” Repository ์šฐํด๋ฆญ > Update Index ์„ ํƒ ํ›„ jarํŒŒ์ผ์ด ์ €์žฅ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•œ๋‹ค. 

์„œ๋ฒ„์—์„œ๋„ ํ•ด๋‹น repository์— ์—…๋กœ๋“œ ๋œ jarํŒŒ์ผ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

Nexus Repository ํ”„๋กœ์ ํŠธ์— ์ ์šฉ

Nexus ์ €์žฅ์†Œ๋ฅผ ํ”„๋กœ์ ํŠธ์— ์ ์šฉํ•˜๊ธฐ ์œ„ํ•ด pom.xml์˜ <repositories>๋ถ€๋ถ„์„ ์•„๋ž˜์ฒ˜๋Ÿผ ์ˆ˜์ •ํ•œ๋‹ค.

Jenkins ๋นŒ๋“œ ์‹œ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ ๋ฐœ์ƒ ์‹œ ์•„๋ž˜์ฒ˜๋Ÿผ ์กฐ์น˜ํ•œ๋‹ค.

maven์—์„œ ๋ณด์•ˆ์ƒ ์™ธ๋ถ€ http ํ†ต์‹ ์ด ์•ˆ๋˜๊ฒŒ๋” ์ •์ฑ…์ด ๋ณ€๊ฒฝ๋˜์—ˆ๊ธฐ์— Nexus ์ €์žฅ์†Œ์˜ http๋ฅผ ๋ฌด๋ ฅํ™” ํ•˜๊ธฐ ์œ„ํ•ด ์„ค์ •ํŒŒ์ผ์˜ ๋ฏธ๋Ÿฌ๋‚ด์šฉ์„ ์ˆ˜์ • ํ›„ ์žฌ๊ธฐ๋™ํ•œ๋‹ค.

vi ~/eGovCI-4.2.0/bin/apache-maven-3.9.6/conf/settings.xml

maven ์žฌ๊ธฐ๋™ ํ›„ Jenkins ์žฌ๋นŒ๋“œ ์‹œ Nexus ์ €์žฅ์†Œ์—์„œ jarํŒŒ์ผ์ด ๋‹ค์šด๋กœ๋“œ ๋จ์„ ํ™•์ธํ•œ๋‹ค.

๋กœ์ปฌ์—์„œ ๋นŒ๋“œ ์‹œ ๋น„์Šทํ•œ ์—๋Ÿฌ ๋ฐœ์ƒ ํ•  ๊ฒฝ์šฐ local repository์— settings.xml ์ƒ์„ฑ ํ›„ ์žฌ์‹œ๋„ํ•œ๋‹ค.

settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">

<mirrors>
<mirror>
    <id>maven-default-http-blocker</id>
    <mirrorOf>external:dont-match-anything-mate:*</mirrorOf>
    <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
    <url>http://0.0.0.0/</url>
</mirror>
</mirrors>


</settings>

๊ฐœ์ธ ์Šคํ„ฐ๋”” ๊ธฐ๋ก์„ ๋ฉ”๋ชจํ•˜๋Š” ๊ณต๊ฐ„์ด๋ผ ํ‹€๋ฆฐ์ ์ด ์žˆ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ํ‹€๋ฆฐ ์  ์žˆ์„ ๊ฒฝ์šฐ ๋Œ“๊ธ€ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.

 

[DevOps] CentOS 8 Jenkins CI, CD ํ™˜๊ฒฝ ๊ตฌ์ถ•(feat. eGovCI)

๋ชฉ์ฐจ์ด๋ฒˆ์—” ์ „์ž์ •๋ถ€ํ”„๋ ˆ์ž„์›Œํฌ์˜ ์„œ๋ฒ„์šฉ ๊ฐœ๋ฐœํ™˜๊ฒฝ์„ ์ด์šฉํ•ด์„œ CI, CD๋ฅผ ๊ตฌ์ถ•ํ–ˆ๋‹ค.๋‹ค์Œ์—” ์ €๋ฒˆ์— ์„ค์น˜ํ•œ GitLab๊ณผ ์ƒˆ๋กœ ์„ค์น˜ํ•œ Jenkins๋กœ ์ฒ˜์Œ๋ถ€ํ„ฐ ์—ฐ๋™ํ•˜๋Š” ๊ฒƒ๋„ ํฌ์ŠคํŒ… ์˜ˆ์ •์ด๋‹ค. [DevOps] CentOS 8 Jen

yaga.tistory.com

 

[DevOps] CentOS 8 GitLab ์„ค์น˜

๋ชฉ์ฐจGitLab ์„ค์น˜๊ณผ์ •#GitLab์˜ CentOS์šฉ RPM ์ €์žฅ์†Œ ์„ค์น˜ํ•˜๊ธฐ ์œ„ํ•œ ์Šคํฌ๋ฆฝํŠธ ๋‹ค์šด๋กœ๋“œ ๋ฐ ์‹คํ–‰curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash#gitlab ์ปค๋ฎค๋‹ˆํ‹ฐ๋ฒ„์ „ ์„ค์น˜sudo yum

yaga.tistory.com

 

[DevOps] CentOS7 ์„ค์น˜๋ถ€ํ„ฐ jdk, mysql, tomcat ์—ฐ๋™๊นŒ์ง€ ๊ณผ์ •

๋ชฉ์ฐจCentOS7 ์„ค์น˜๋ถ€ํ„ฐ jdk, mysql, tomcat ์„ค์น˜ ๋ฐ ๊ฐ„๋‹จํ•œ ์—ฐ๋™๊ณผ์ •์„ ๊ฐ„๋žตํžˆ ํฌ์ŠคํŒ…ํ•œ๋‹ค.CentOS ๋ฏธ๋Ÿฌ ์‚ฌ์ดํŠธ์—์„œ isovํŒŒ์ผ ๋‹ค์šด๋กœ๋“œํ•œ๋‹ค.(์—ฌ๊ธฐ์„  GUIํ™˜๊ฒฝ์œผ๋กœ ์„ค์น˜ํ•˜๊ธฐ ์œ„ํ•ด DVD ์„ ํƒ)CentOS7 ์„ค์น˜๋ฆฌ๋ˆ…์Šค ๋ถ€

yaga.tistory.com

'IT > DevOps' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

[git] git revert  (40) 2024.06.06
[git] git reset(feat. soft, mixed, hard)  (36) 2024.06.06
[DevOps] CentOS 8 Jenkins CI, CD ํ™˜๊ฒฝ ๊ตฌ์ถ•(feat. eGovCI)  (61) 2024.05.03
[DevOps] CentOS 8 GitLab ์„ค์น˜  (35) 2024.05.01
[DevOps] CentOS 8 JenKins ์„ค์น˜(feat. CI, CD)  (37) 2024.05.01

๋Œ“๊ธ€