我是靠谱客的博主 粗暴水杯,这篇文章主要介绍jenkins(三)后端自动化部署,现在分享给大家,希望可以做个参考。

General

一、项目名称:any-project-name

二、参数化构建过程

1、String Parameter

①、

名字: PROJECT_POM

默认值: pom.xml

②、

名字: deploy_path

默认值: /your-project-web/target/

③、

名字: jar_name

默认值: your-project.jar

④、

名字: health_check(可选)

默认值: 8089/api/common/health_check

描述: health_check

⑤、

名字: build_branch

默认值: master

描述: build_branch

2、Choice Parameter

①、

Name: SERVER_LIST

Choices: 10.1.2.16

②、

Name: build_type

Choices: beta

dev

master

 

源码管理

Git

一、Repositories

1、Repository URL: your-git@git.cn:project/your-project.git

2、Credentials : none

二、Branches to build

Branch Specifier(blank for 'any'): ${build_branch}

三、源码库浏览器:自动

 

构建环境

一、Add timestamps to the Console Output

二、Color ANSI Console Output

ANSI color map:xterm

三、Set jenkins user build variables

 

构建

Execute shell

Command:

#!/bin/bash

/data/jenkins/workspace/ops-scripts/tmp_beta_prod_build.sh

脚本(tmp_beta_prod_build.sh):

#!/bin/bash
source /etc/profile
msg() {
    printf '%bn' "$1" >&2
}

success() {
    msg "33[32m[✔] ${1}${2} 33[0m "
}

warn(){
    msg "33[33m[✔] ${1}${2} 33[0m "
}

error() {
    msg "33[31m[✘] ${1}${2} 33[0m"
}

error_exit() {
    msg "33[31m[✘] ${1}${2} 33[0m"
    

最后

以上就是粗暴水杯最近收集整理的关于jenkins(三)后端自动化部署的全部内容,更多相关jenkins(三)后端自动化部署内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(51)

评论列表共有 0 条评论

立即
投稿
返回
顶部