jenkins及其組件安裝
1.1安裝python3.5
1.2pip安裝ansible
[root@localhost ~]# /usr/local/python/bin/pip3 install ansible
[root@localhost ~]# ln -s /usr/local/python/bin/ansible /usr/local/bin/
[root@localhost ~]# ansible --version
ansible 2.6.4
config file = None
configured module search path = [‘/root/.ansible/plugins/modules‘, ‘/usr/share/ansible/plugins/modules‘]ansible python module location = /usr/local/python/lib/python3.5/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.5.2 (default, Sep 7 2018, 20:17:38) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]1.3ansible查看幫助
[root@localhost ~]# /usr/local/python/bin/ansible-doc -l 查看總幫助
[root@localhost ~]# /usr/local/python/bin/ansible-doc -s shell 查看shell模塊的幫助
2.安裝tomcat
2.1安裝jdk
[root@localhost ~]# tar xf jdk-8u171-linux-x64.gz -C /usr/local
[root@localhost ~]# mv /usr/local/jdk1.8.0_171 /usr/local/jdk
[root@localhost ~]# sed -i.ori ‘$a export JAVA_HOME=/usr/local/jdk\nexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH\nexport CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar‘ /etc/profile[root@localhost ~]# source /etc/profile
[root@localhost ~]# java -version
java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
[root@localhost ~]# tail -3 /etc/profile
export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar2.2安裝tomcat
[root@localhost ~]# tar xf apache-tomcat-9.0.8.tar.gz -C /usr/local
[root@localhost ~]# export JAVA_HOME=/usr/local/jdk
[root@localhost ~]# tar xf apache-tomcat-9.0.8.tar.gz -C /usr/local
[root@localhost ~]# mv /usr/local/apache-tomcat-9.0.8/ /usr/local/tomcat
[root@localhost ~]# echo ‘export TOMCAT_HOME=/usr/local/tomcat‘ >> /etc/profile
[root@localhost ~]# source /etc/profile/usr/local/tomcat/bin/startup.sh
/usr/local/tomcat/bin/shutdown.sh2.3安裝maven
[root@localhost ~]# tar xf apache-maven-3.5.3-bin.tar.gz -C /usr/local/
[root@localhost local]# mv /usr/local/apache-maven-3.5.3/ /usr/local/maven
[root@localhost ~]# sed -ri.bak ‘$a export MAVEN_HOME=/usr/local/maven \nexport PATH="$MAVEN_HOME/bin:$PATH"‘ /etc/profile
[root@localhost ~]# tail -2 /etc/profile
export MAVEN_HOME=/usr/local/maven
export PATH="$MAVEN_HOME/bin:$PATH"
[root@localhost local]# source /etc/profile
[root@localhost local]# mvn -version
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T14:49:05-05:00)
Maven home: /usr/local/maven
Java version: 1.8.0_171, vendor: Oracle Corporation
Java home: /usr/local/jdk/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.10.0-862.el7.x86_64", arch: "amd64", family: "unix"
3.安裝jenkins
3.1清除webapps下的ROOT以外的目錄和ROOT下的文件
[root@localhost webapps]# mv docs/ examples/ host-manager/ manager/ /tmp
[root@localhost ROOT]# rm -fr *3.2jenkins移過來
[root@localhost ROOT]# mv ~/jenkins.war /usr/local/tomcat/webapps/ROOT3.3解壓war包
[root@localhost ROOT]# jar xvf jenkins.war3.4訪問
ip:80803.5jenkins初始密碼
[root@localhost ROOT]# cat /root/.jenkins/secrets/initialAdminPassword
36fa4201d20f4772912aa0cfb52df8c7
4.自建gitlab倉庫
jenkins及其組件安裝