๋ฐ๋๋ผ ์๋ฐ์คํฌ๋ฆฝํธ๋ก ๊ตฌํํ ํ์ด๋จธ๐คฉ
InSeong-So |
heeney |
aws ๊ฐ์
ec2 ami ์ ํ(ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server), t2-micro, 22/80/9999, ํค ์๋ก ์์ฑ(jenkins-ec2)
window ์์๋ ํด๋ ๊ถํ์ ์ ๊ฑฐํด์ค๋ค
cd ๋๋ ํ ๋ฆฌ
ssh -i "jenkins-ec2.pem" AWS_IP
$ sudo apt update -y
$ sudo apt upgrade -y
$ sudo apt install -y openjdk-11-jdk
$ sudo apt install -y docker.io
$ sudo apt install -y nginx
$ wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add
$ echo deb http://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FCEF32E745F2C3D5
$ sudo apt update -y
$ sudo apt install -y jenkins
$ sudo vi /etc/default/jenkins
HTTP_PORT=9999
$ sudo systemctl restart jenkins
http://ํผ๋ธ๋ฆญIP:9999
[์ด๊ธฐ๋น๋ฐ๋ฒํธ] sudo cat /var/lib/jenkins/secrets/initialAdminPassword
$ cd /etc/nginx
$ sudo rm nginx.conf
$ sudo vi nginx.conf
$ sudo systemctl reload nginx
$ sudo usermod -aG docker jenkins
$ sudo su -s /bin/bash jenkins
$ mkdir /var/lib/jenkins/.ssh
$ ssh-keygen -t rsa -b 4096 -C "wh-key" -f /var/lib/jenkins/.ssh/jenkins-github-wh
$ cat /var/lib/jenkins/.ssh/jenkins-github-wh.pub
์ ํจ์ค ๊ด๋ฆฌ - Manage Credentials - add credential - SSH Username with private key
Scope๋ฅผ Global์ Jenkins Node๋ก ์ค์ ํ ๋ค, Username ์ ์๊น ๋ง๋ค์ด์ค RSA Key์ ์ด๋ฆ๊ณผ ๋์ผํ๊ฒ ์ค์
$ cat /var/lib/jenkins/.ssh/jenkins-github-wh
๋์๋ณด๋-์๋ก์ดItem-Freestyle Project