์ƒˆ์†Œ์‹

DevOps/CIใƒปCD

[Jenkins] ์  ํ‚จ์Šค ์„ค์น˜ ๋ฐ ๊ด€๋ จ ๋‚ด์šฉ ์ •๋ฆฌ

  • -

 

 

Jenkins์— ๋Œ€ํ•œ ์„ค์น˜ ๊ณผ์ •๊ณผ ํ•„์š”ํ•œ ์ •๋ณด๋ฅผ ๊ธฐ๋กํ•˜๋Š” ๋ชฉ์ ์œผ๋กœ ์ž‘์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ถ”ํ›„ ๋‚ด์šฉ์ด ์ถ”๊ฐ€๋  ์ˆ˜ ์žˆ์œผ๋ฉฐ ์ฐธ๊ณ ์šฉ์œผ๋กœ๋งŒ ํ™•์ธ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.


 

Jenkins ์„ค์น˜

 

apt ์ตœ์‹  ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ

sudo apt-get update

 

jdk 8์„ค์น˜

** ๋ฒ„์ „ ์„ ํƒ์€ ์ž์œ 

sudo apt-get install openjdk-8-jdk

 

jenkins ์ €์žฅ์†Œ key ๋‹ค์šด๋กœ๋“œ

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -

 

sources.list์— ์ถ”๊ฐ€

echo deb http://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list

 

key ๋“ฑ๋ก

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FCEF32E745F2C3D5

 

apt ์žฌ ์—…๋ฐ์ดํŠธ

sudo apt-get update

 

jenkins ์„ค์น˜

sudo apt-get install jenkins

 

jenkins ์„œ๋ฒ„ ํฌํŠธ ๋ณ€๊ฒฝ

** ๊ธฐ๋ณธ ํฌํŠธ 8080์„ ์œ ์ง€ํ•œ๋‹ค๋ฉด ํŒจ์Šคํ•ด๋„ ๋ฌด๋ฐฉ

sudo vi /etc/default/jenkins
# (์ฐธ๊ณ ) HTTP_PORT=9000

 

๋ฐฉํ™”๋ฒฝ ์„ค์ •

sudo ufw allow 9090
sudo ufw status

 

jenkins ์„œ๋น„์Šค ์žฌ๊ธฐ๋™

sudo service jenkins restart

 

jenkins ์„œ๋น„์Šค ์ƒํƒœ ํ™•์ธ

sudo systemctl status jenkins

 

์„ค์ •ํ•œ ip ๋˜๋Š” ๋„๋ฉ”์ธ์œผ๋กœ ์ ‘์† ํ›„ jenkins ์ดˆ๊ธฐ ๋น„๋ฐ€๋ฒˆํ˜ธ ๊ฒฝ๋กœ ํ™•์ธ

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

 

์„ค์ • ๋งˆ๋ฌด๋ฆฌ

-> 'Customize Jenkins'์—์„œ 'Install suggested plugins' ์„ ํƒ

 

 

 

๋ช…๋ น์–ด ๊ด€๋ฆฌ

 

์‹คํ–‰

sudo service jenkins start

 

๋ฉˆ์ถค

sudo service jenkins stop

 

์žฌ์‹œ์ž‘

sudo service jenkins restart

 

์ƒํƒœํ™•์ธ

sudo systemctl status jenkins

 

 

 

์  ํ‚จ์Šค ๊ด€๋ จ ์ •๋ณด ๊ธฐ๋ก

 

์œ ์ € ์ถ”๊ฐ€

- Jenkins ๊ด€๋ฆฌ > Manage Users > ์‚ฌ์šฉ์ž ์ƒ์„ฑ > ์ •๋ณด ๊ธฐ์ž… ํ›„ 'Create User'

 

์œ ์ € ๊ถŒํ•œ ๋ถ€์—ฌ

- Jenkins ๋ฉ”์ธ ํ™”๋ฉด > Jenkins ๊ด€๋ฆฌ > Configure Global Secutiry > Access Control > Authorization > Matrix-based security
- Anonymous Users & Authenticated Users ์ด์™ธ์— ์•ž์„œ ์ถ”๊ฐ€ํ•œ User๋ฅผ Add user or Group ๋ฒ„ํŠผ์œผ๋กœ ์ถ”๊ฐ€

 

๊ฐ ๋ฉ”ํŠธ๋ฆญ์— ๋Œ€ํ•œ ์„ค๋ช…

ํ•ญ๋ชฉ ๊ถŒํ•œ ์˜๋ฏธ
Overall Administer ์‹œ์Šคํ…œ์˜ ์ „์—ญ ์„ค์ •์„ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ๋‹ค. OS ์—์„œ ํ—ˆ์šฉ๋œ ๋ฒ”์œ„์•ˆ์—์„œ ์ „์ฒด ์‹œ์Šคํ…œ ์—‘์„ธ์Šค๋“œ์˜ ๋งค์šฐ ๋ฏผ๊ฐํ•œ ์„ค์ •์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค.
Read ์  ํ‚จ์Šค์˜ ๋ชจ๋“  ํŽ˜์ด์ง€๋ฅผ ๋ณผ ์ˆ˜ ์žˆ๋‹ค.
RunScripts ๊ทธ๋ฃจ๋น„ ์ฝ˜์†”์ด๋‚˜ ๊ทธ๋ฃจ๋น„ CLI ๋ช…๋ น์„ ํ†ตํ•ด ๊ทธ๋ฃจ๋น„ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค.
UploadPlugins ํŠน์ • ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์—…๋กœ๋“œ ํ•  ์ˆ˜ ์žˆ๋‹ค.
ConfigureUpdateCenter ์—…๋ฐ์ดํŠธ ์‚ฌ์ดํŠธ์™€ ํ”„๋ก์‹œ ์„ค์ •์„ ํ•  ์ˆ˜ ์žˆ๋‹ค.
Slave Configure ๊ธฐ์กด ์Šฌ๋ ˆ์ด๋ธŒ ์„ค์ • ๊ฐ€๋Šฅ
Delete ๊ธฐ์กด ์Šฌ๋ ˆ์ด๋ธŒ ์‚ญ์ œ
Create ์‹ ๊ทœ ์Šฌ๋ ˆ์ด๋ธŒ ์ƒ์„ฑ
Disconnect ์Šฌ๋ ˆ์ด๋ธŒ ์—ฐ๊ฒฐ์„ ๋Š๊ฑฐ๋‚˜ ์Šฌ๋ ˆ์ด๋ธŒ๋ฅผ ์ž„์‹œ๋กœ ์˜คํ”„๋ผ์ธ์œผ๋กœ ํ‘œ์‹œ.
Connect ์Šฌ๋ ˆ์ด๋ธŒ์™€ ์—ฐ๊ฒฐํ•˜๊ฑฐ๋‚˜ ์Šฌ๋ ˆ์ด๋ธŒ๋ฅผ ์˜จ๋ผ์ธ์œผ๋กœ ํ‘œ์‹œ;
Job Create ์ƒˆ๋กœ์šด ์ž‘์—… ์ƒ์„ฑ
Delete ๊ธฐ์กด ์ž‘์—… ์‚ญ์ œ.
Configure ๊ธฐ์กด ์ž‘์—…์˜ ์„ค์ • ๊ฐฑ์‹ 
Read ํ”„๋กœ์ ํŠธ ์„ค์ •์— ์ฝ๊ธฐ ์ „์šฉ ๊ถŒํ•œ ๋ถ€์—ฌ
Discover ์ต๋ช… ์‚ฌ์šฉ์ž๊ฐ€ ์ž‘์—…์„ ๋ณผ ๊ถŒํ•œ์ด ์—†์œผ๋ฉด ์—๋Ÿฌ ๋ฉ”์‹œ์ง€ ํ‘œ์‹œ๋ฅผ ํ•˜์ง€ ์•Š๊ณ  ๋กœ๊ทธ์ธ ํผ์œผ๋กœ ์ „ํ™˜ ์‹œํ‚ด
Build ์ƒˆ๋กœ์šด ๋นŒ๋“œ ์‹œ์ž‘.
Workspace Workspace
Cancel ์‹คํ–‰์ค‘์ธ ๋นŒ๋“œ ์ทจ์†Œ
Run Delete ๋นŒ๋“œ ๋‚ด์—ญ์—์„œ ํŠน์ • ๋นŒ๋“œ ์‚ญ์ œ
Update ๋นŒ๋“œ์˜ ์„ค๋ช…๊ณผ ๊ธฐํƒ€ ํ”„๋กœํผํ‹ฐ ์ˆ˜์ •(๋นŒ๋“œ ์‹คํŒจ ์‚ฌ์œ ๋“ฑ)
View Create ์ƒˆ๋กœ์šด ๋ทฐ ์ƒ์„ฑ
Delete ๊ธฐ์กด ๋ทฐ ์‚ญ์ œ
Configure ๊ธฐ์กด ๋ทฐ ์„ค์ • ๊ฐฑ์‹ 
Read ๊ธฐ์กด ๋ทฐ ๋ณด๊ธฐ
SCM Tag ํŠน์ • ๋นŒ๋“œ์™€ ๊ด€๋ จ๋œ ์†Œ์Šค ๊ด€๋ฆฌ ์‹œ์Šคํ…œ์— ํƒœ๊น…์„ ์ƒ์„ฑ.

 

Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค. ๐Ÿ˜Š

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค. ๐Ÿ‘