jenkins自动化部署

1.官网下载jenkins包

2.使用脚本启动jenkins----restrtJenkins.sh脚本内容如下

#!/bin/bash

PID=`ps -ef | grep 'jenkins.war' | grep -v grep | awk '{print $2}'`
if [[ "" !=  "$PID" ]]; then
  echo "killing jenkins : $PID"
  kill $PID
fi

sleep 1

LOGS_DIR=/home/heqs/yx/jenkins/logs

MAIN_JAR="-jar ./jenkins/jenkins.war --httpPort=8568 "
JAVA_ARGS="-server -Xms2048m -Xmx2048m -XX:NewSize=1500m -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=70 -XX:+PrintGCDetails -XX:+PrintHeapAtGC  -XX:ThreadStackSize=512 -Xloggc:${LOGS_DIR}/gc.log "

nohup java ${JAVA_ARGS} ${MAIN_JAR} 1>>${LOGS_DIR}/stdout.log 2>>${LOGS_DIR}/stderr.log &
echo "startup jenkins ..."

3.遇到问题就是

[root@local heqs]# telnet 192.168.122.1 8568
Trying 192.168.122.1...
Connected to 192.168.122.1.
Escape character is '^]'.
Connection closed by foreign host.

一直报这个错误,最后ifconfig查看地址,使用另外一个发现可以通,jenkins启动成功,可能是映射地址的关系吧

jenkins自动化部署

 

3.打开之后需要输入用户名密码,默认用户名是admin,密码在 /root/.jenkins/secrets/initialAdminPassword,输入之后登录成功

 

上一篇:iOS 百度地图获取地理位置名称


下一篇:jeecgboot运行磁盘不足问题( java.io.IOException)