【devops】在Ubuntu 上安装 Jenkins

install Java

1.Install software-properties-common so we can add custom aptitude repositories:

sudo apt-get install software-properties-common

2.Add a Personal Package Archive that has a Java installer:

sudo apt-add-repository ppa:webupd8team/java

3.Update aptitude packages:

sudo apt-get update

4.Install Java 8:

sudo apt-get install oracle-java8-installer

check java version

java -version

install Jenkins

wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo apt-get install jenkins

change port

vim /etc/default/jenkins
port for HTTP connector (default 8080; disable with -1)
HTTP_PORT=8080

begin jenkins

sudo service jenkins start

note

如果用腾讯云,请开启安全组策略

登陆密码

cat /var/lib/jenkins/secrets/initialAdminPassword

然后自己进行一系列活动,下篇文件讲 job任务

相关推荐