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 '%b\n' "$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"
    
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Ansel_TbN1

您的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值