4 Global Tool Configuration
PATH是在 系统管理->系统配置中指定的PATH
4.1 git (可以是全局,但git路径需要体现在PATH中)
4.2 gitlab
4.3 maven(可以是全局, 但MAVEN_HOME需要体现在命令行或者PATH中)
4.4 jdk(可以是全局,但JAVA_HOME需要体现在命令行或者PATH中)
5 项目配置
5.1 项目名称
5.2 Gitlab Connection: Gitlab账号
5.3 丢弃的旧构建
5.4 参数化构建过程
名称:COMMIT 默认值:master 描述:git版本号,可以是hash和分支
5.5 源码管理
GIT, Repository url ,
Credentials
kind: ssh key userName: 机器建立的账号,如jenkins private key: From the Jenkins master ~/.ssh
description
5.6 构建触发器
5.7 Pre Steps
execute shell
echo $PATH
git checkout $COMMIT
5.8 Build
Root Pom: 相对项目根路径,如 xxx-platform/emergency-api/pom.xml
Goals and options: package -Dmaven.test.skip=true
5.9 Post steps
mv xxx-platform/emergency-api/emergency-plan/target/emergency-plan-*-SNAPSHOT.jar xxx-platform/emergency-api/emergency-plan/target/emergency-plan.jar
5.10 Email notification
5.11 构造后操作,需要插件支持
a. Archive the artifacts
用于存档的文件:xxx-platform/emergency-api/emergency-plan/target/*.jar
b. Send build artifacts over ftp (Publish over ftp插件)
source files: xxx-platform/emergency-api/emergency-plan/target/*.jar
remove prefix: xxx-platform/emergency-api/emergency-plan/target
remote directory: prod/plan/$GIT_COMMIT
6 vsftpd搭建
6.1 安装: yum install vsftpd
6.2 配置:
a. 配置文件 /etc/vsftpd/vsftpd.conf 后面加三行
userlist_deny=NO
use_localtime=YES
userlist_file=/etc/vsftpd/user_list
b. 配置文件 /etc/vsftpd/user_list 后面加上 jenkins用户,该用户必须是linux用户, 修改用户密码
c. 配置jenkins vsftpd SERVER, 系统管理中Ftp-Servers, Name(名字,貌似可以随便填), HostName,
Username(第二步中用户名), Password(第二步中用户密码)