sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
yum install jenkins
安装完之后找到jenkins的war包
find -name "jenkins"
nohup java -jar jenkins.war --httpPort=9090 &
访问网址:http://192.168.206.193:9090/ (自己的IP+9090)
cat /root/.jenkins/secrets/initialAdminPassword #查看密码
5、新建工程
clean package -Dmaven.test.skip=true
echo "Stopping Demo Application" pid=`ps -ef | grep demo-0.0.1-SNAPSHOT.jar | grep -v grep | awk ‘{print $2}‘` if [ -n "$pid" ] then kill -9 $pid fi mv -f /root/.jenkins/workspace/maven-demo/target/demo-0.0.1-SNAPSHOT.jar /usr/local/demo-0.0.1-SNAPSHOT.jar chmod 777 /usr/local/start_demo.sh BUILD_ID=dontKillMe /usr/local/start_demo.sh
nohup java -jar /usr/local/demo-0.0.1-SNAPSHOT.jar > /usr/local/demo.log 2>&1 &