tar xzf TeamCity-9.0.4.tar.gz
软件准备
系统:Centos 6.4 64位
JAVA: jdk1.7.0_25
数据库:自选(只做持续集成部署没有必要自己定制数据库)
Teamcity:TeamCity-9.0.4.tar.gz
安装配置
1)解压软件
tar xzf TeamCity-9.0.4.tar.gz
2)配置Teamcity
#添加启动JAVA_OPTS vim $TEAMCITY_HOME/bin/catalina.sh 99行 JAVA_OPTS="-Xms4096m -Xmx4096m -XX:PermSize=1024M -XX:MaxNewSize=512m -XX:MaxPermSize=1024m" #更改启动端口添加中文显示 vim $TEAMCITY_HOME/conf/server.xml 71行 port="8111" 改为port="80"#根据自己的需求 URIEncoding="UTF-8" ###log4j等自行定义
3)启动Teamcity-安装
###根据提示创建日志文件 touch: cannot touch `/jboss/TeamCity/logs/catalina.out‘: No such file or directory mkdir $TEAMCITY_HOME/logs
4)配置Teamcity
(1)下载Teamcity插件***最重要的一步不然会走很多弯路
(2)下载完后上传插件
(3)重启Teamcity:附脚本
#!/bin/bash #For Linux Teamctiy #Auto:LonnyLiu #Email:[email protected] TEAMCITY_HOME=${TEAMCITY_HOME:-"/jboss/TeamCity"} JAVA_HOME=${JAVA_HOME:-"/jboss/jdk1.7.0_25"} start () { echo "start TEAMCITY" $TEAMCITY_HOME/bin/startup.sh TEAMCITY_PID=${TEAMCITY_PID:-"`ps aux | grep java | grep TeamCity | awk ‘{print $2}‘`"} if [ ! -n "$TEAMCITY_PID" ];then echo "Start TeamCity Fail" else echo "Start TeamCity Successful" fi } stop () { echo "Stop TEAMCITY" $TEAMCITY_HOME/bin/shutdown.sh TEAMCITY_PID=${TEAMCITY_PID:-"`ps aux | grep java | grep TeamCity | awk ‘{print $2}‘`"} if [ ! -n "$TEAMCITY_PID" ];then echo "STOP TeamCity Successful" else kill -9 $TEAMCITY_PID echo "STOP TeamCity Fail Run Kill" fi } case $1 in start) start; ;; stop) stop; ;; restart) stop; sleep 10 start; ;; *) echo "Usage:$0(start|stop|restart)" exit 1 esac
(4)配置项目部署
时间: 2024-11-09 22:49:57