启动:
java -jar jenkins.war
自带Jboss,不需要Tomcat
配置
进入http://localhost:8080/
粘贴控制台的加密密码进入系统,创建第一个管理员用户。
在系统管理->Global Tool Configuration -> Maven 中新增一个Maven,输入名字,选中自动安装,会自动下载并安装maven。
插件
系统管理 -> Manage Plugins ->Available
搜索:Maven Integration Plugin
安装完成后重启
关闭 重启 重载配置
关闭:http://localhost:8080/exit 点Try POSTing
重启:http://localhost:8080/restart 点yes
重载:http://localhost:8080/reload 点Try POSTing
使用
1.点击New Item 新建一个项目,选择Freestyle project,点OK
2.选择Source Code Management,源码在SVN就选Subversion
- 选择Build,Add build step
maven 项目就选Invoke top-level Maven targets
Maven Version 选择之前配置好的maven版本
Goals 就是要构建的mvn目标了
我们这里输入 clean install -Dmaven.test.skip=true
- 配置好后就可以执行构建了,点击Build Now 就会在下方生成一个构建任务,红色表示失败,蓝色表示构建成功。
在workspace里可以看到构建成功的项目
相对路径
构建触发器
部署
rm -rf /var/dailybuild/isap
mkdir -p /var/dailybuild/isap
mkdir -p /var/dailybuild/isap/www
mkdir -p /var/dailybuild/isap/mysql
mkdir -p /var/dailybuild/isap/mysql/create_tables
mkdir -p /var/dailybuild/isap/mysql/init_tables
cd /var/dailybuild/isap
cp -rf ${WORKSPACE}/isap-external/mysql/* mysql
cp -rf ${WORKSPACE}/isap-parent/isap-dao/dao/0.CreateDatabase/* mysql
cp -rf ${WORKSPACE}/isap-parent/isap-dao/dao/1.CreateTable/createtables.sh mysql
cp -rf ${WORKSPACE}/isap-parent/isap-dao/dao/1.CreateTable/t_*.sql mysql/create_tables
cp -rf ${WORKSPACE}/isap-parent/isap-dao/dao/2.InitData/inittables.sh mysql
cp -rf ${WORKSPACE}/isap-parent/isap-dao/dao/2.InitData/t_*.sql mysql/init_tables
cp -rf ${WORKSPACE}/isap-parent/isap-dao/dao/5.install/* mysql
chmod 755 mysql/*
find ./isap -type d -name .svn | xargs rm -rf
tar zcvf mysql.tar.gz mysql
rm -rf mysql
cp -rf ${WORKSPACE}/htdocs/* www
tar zcvf www.tar.gz www
rm -rf www
cd ../
cp -rf ${WORKSPACE}/isap-parent/isap-bin/isap-bin-server/target/isap-bin-server*.zip isap
cp -rf ${WORKSPACE}/isap-external/install/* isap
cp -rf ${WORKSPACE}/isap-external/web/* isap
cp -rf ${WORKSPACE}/isap-external/apache-activemq*bin.tar.gz isap
cp -rf ${WORKSPACE}/isap-external/jdk-*-linux-x64.rpm isap
cp -rf ${WORKSPACE}/isap-external/zookeeper-*.tar.gz isap
chmod 755 isap/*
tar zcvf isap_linux.tar.gz isap
rm -rf isap/*
cp -rf ${WORKSPACE}/isap-external/jni/* isap
cp -rf ${WORKSPACE}/isap-external/vcredist*.exe isap
cp -rf ${WORKSPACE}/isap-parent/isap-bin/isap-bin-proxy-instance/target/isap-bin-proxy-instance*.zip isap
cp -rf ${WORKSPACE}/isap-parent/isap-bin/isap-bin-proxy-manager/target/isap-bin-proxy-manager*.zip isap
find ./isap -type d -name .svn | xargs rm -rf
zip -q -r isap_windows.zip isap
rm -fr isap