(1)环境介绍
(2)配置ssh配置:系统管理--->系统设置
做这样的配置是方便打包之后war包或jar包复制到/tomcat/update目录下
(3)安装git
1丶不要使用1.8版本以下的git
yum install -y epel-releaseyum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker unzip test -d /tools || mkdir tools cd /tools wget https://github.com/git/git/archive/v2.7.4.zipunzip v2.7.4cd git-2.7.4make prefix=/usr/local/git allmake prefix=/usr/local/git installrm -rf /usr/bin/gitln -s /usr/local/git/bin/git /usr/bin/gitgit --version
(4)maven安装配置
1丶maven安装
wget http://mirrors.hust.edu.cn/apache/maven/maven-3/3.5.3/binaries/apache-maven-3.5.3-bin.tar.gztar xf apache-maven-3.5.3-bin.tar.gz -C /usr/localln -sv /usr/local/apache-maven-3.5.3/ /usr/local/mavenexport PATH=$PATH:/usr/local/maven/binecho "PATH=$PATH:/usr/local/maven/bin" >>/etc/profileln -sv /usr/local/maven/bin/mvn /usr/bin/mvnmvn -v
2丶jenkins新增配置maven
(5)生成公钥上传到gitlab服务器
1丶生成公钥
ssh-keygen -t rsa -C "test@qq.com" -b 4096
2丶上传到gitlab
/root/.ssh/id_rsa.pub 文件内容复制到gitlab上