Install
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
When the key is added, the system will return OK
. Next, append the Debian package repository address to the server's sources.list
:
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'sudo apt update
sudo apt install jenkins
sudo systemctl start jenkins
sudo systemctl status jenkins
sudo ufw allow 8080
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Setup Jenkins for private GitHub repository
sudo su jenkins
whoami
(should tell you that currently you're 'jenkins')ssh-keygen -t rsa -b 4096 -C "xxx@gmail.com" # use your email for Jenkins GitHub account
exit
Look ssh at file id_rsa and id_rsa.pub at
cd /var/lib/jenkins/.ssh/
add id_rsa.pub on your github at menu SSH and GBP KEY
add id_rsa on your Jenkins at menu Add Credentials
Change workspace directory
cat /var/lib/jenkins/conf