CI / CD manual operation under the traditional cloud environment (E) configuration jenkins

Installation Configuration Jenkins
CD / usr / local / the src /
the tar-xvf JDK 7u79-Linux-x64.tar.gz
LN -sv /usr/local/src/jdk1.7.0_79 / usr / local / JDK
Vim / etc / Profile
Export the JAVA_HOME = / usr / local / JDK
Export the PATH = $ the JAVA_HOME / bin: $ the JAVA_HOME / JRE / bin: $ the PATH
Export the CLASSPATH = $ the CLASSPATH:. $ the JAVA_HOME / lib: $ the JAVA_HOME / JRE / lib: $ the JAVA_HOME / lib / Tools .jar
Source / etc / Profile && Java -version
yum the install Jenkins -Y-2.138.4-1.1.noarch.rpm
Vim / etc / sysconfig / Jenkins
JENKINS_HOME = "/ var / lib / Jenkins" # default installation path
JENKINS_USER = " root "# launch customer, the default is Jenkins
JENKINS_PORT =" 8080 "# Enable port
systemctl restart Jenkins
chkconfig Jenkins oN
tail -f /var/log/jenkins/jenkins.log
first position of the initial password will be prompted to login
cat / var / lib / jenkins / secrets / initialAdminPassword
plug installation location: / var / lib / jenkins / plugins

Free secret code fetching achieve gitlab pull
yum the install Git -Y
SSH-keygen
CAT /root/.ssh/id_rsa.pub #root user
configuration pub-key is generated on the above gitlab:
Click projects --- your projects-- -projects name --- gear icon Settings
--- Repository Deploy Keys --- --- --- click enter key values Write access allowed
other projects use the same key, but to enable manual Deploy Keys interface
and then test password-free pulling codes
git clone [email protected]: group1 / project1.git # ( first pull will need to enter yes)

Configuring credential private key implementation source code management
cat /root/.ssh/id_rsa #root private
jenkins --- --- --- System credentials Global credentials --- --- add credential types SSH username with private key --- username: root --- increase above Private Key
test
new jenkins pipeline project --- the source code management Git --- Repository URL: [email protected]: group1 / project1.git --- Credentials: root --- building immediately

Implement password-free scp file to Tomcat
SSH-Copy-the above mentioned id [email protected]
SSH-Copy-the above mentioned id [email protected]
SSH 192.168.1.17
SSH 192.168.1.18
RM -rf project1
git clone [email protected]: group1 / project1 .git
scp project1 / [email protected]: / the Data / Tomcat / webapps / web01 /
scp project1 /
[email protected]: / the Data / Tomcat / webapps / web01 /

Guess you like

Origin blog.51cto.com/dongdong/2423621