How to Install and Configure Jenkins
Install Jenkins
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
sudo rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
yum -y install jenkins
yum -y install java-1.8.0-openjdk
systemctl enable jenkins
systemctl start jenkins
yum -y install setroubleshoot-server selinux-policy-devel
sepolicy network -t http_port_t
semanage port -m -t http_port_t -p tcp 8080
Nginx Reverse Proxy config
Configure Jenkins
Jenkins User
cat /etc/passwd |grep jenkins
jenkins:x:998:996:Jenkins Automation Server:/var/lib/jenkins:/bin/false
change false to bash
vi /etc/passwd
jenkins:x:998:996:Jenkins Automation Server:/var/lib/jenkins:/bin/bash
set a password for jenkins
passwd jenkins
<enter your password>
su - jenkins
ssh-keygen
ssh-copy-id jenkins@localhost
visudo
after
root ALL=(ALL) ALL
add
jenkins ALL=(ALL) NOPASSWD: ALL