Jenkins自动化部署到多台服务器配置

1:Jenkins秘钥查看

需要查看秘钥,


然后在**.16.200.22和**.16.200.28服务器的目录下面将Jenkins秘钥放到~/.ssh/authorized_keys文件里。


3:Jenkins自动化部署到多台服务器脚本

library 'lib-base@master'

def map = [:]

//######传参########

map.put('GIT_URL','http://172.16.0.1/FN-PM0091/cdd.git')

map.put('GIT_BRANCH','master')

map.put('GIT_CRED_ID','jenkins')

def archivelist=[]

archivelist.add('job-excutor/target/cdd1.jar')

map.put('ARCHIVE_FILE',archivelist)

// skywalking 服务目录

def SKYWALKING_DIR = '/usr/local/apps/apache-skywalking-apm-bin-es7'

// skywalking oap 服务地址

def SKYWALKING_OAP_IP = '172.16.200.54'

def SKYWALKING_OAP_PORT = 11800

def deploylist=[]


deploylist.add("runjar -f 'cdd-service/target/cdd1.jar' -v '/data/cddm'  -j '-Xms512m -Xmx512m' -h **.16.200.28")

deploylist.add("runjar -f 'report-executor/target/cdd1.jar' -v '/data/cddm' -j '-Dnacos.logging.default.config.enabled=false -Xms512m -Xmx512m' -h **.16.200.22")

map.put('DEPLOY_RUN',deploylist)

//################

DockerBuild("maven",map);

你可能感兴趣的:(Jenkins自动化部署到多台服务器配置)