Install Jenkins for Ubuntu operation system

https://jenkins.io/zh/doc/boo...

  1. install java
  2. wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
  3. add the following entry in your /etc/apt/sources.list
    deb https://pkg.jenkins.io/debian-stable binary/
  4. sudo apt-get update
  5. sudo apt-get install jenkins
  6. set environment path
   export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
   export JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/
   export CLASSPATH=$JRE_HOME/lib:$CLASSPATH
   export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
  1. source /etc/profile
  2. java -jar /usr/share/jenkins/jenkins.war --httpPort=1080
  3. restart jenkins
    /etc/init.d/jenkins restart
  4. open in browser
    127.0.0.1:1080
  5. login jenkins
  6. install recommended plugins
  7. create admin user
  8. config jenkins
  9. generate public key for git repositories
    1). cd ~/.ssh
    2). ssh-keygen // this will generate id_dsa and id_dsa.pub
    3). copy the text in id_dsa.pub to git -> settings -> SSH Keys -> key
  10. Set up new item -> source code management -> git -> repositories -> credentials -> add -> SSH Username with private key -> copy public key here.

你可能感兴趣的:(jenkins-ci,ubuntu18.04,devops)