Gokins 项目部署
公共配置
变量
变量名 |
变量值 |
|
time |
date "+%Y%m%d%H%M%S" |
|
LAST_COMMIT_ID |
git rev-parse --short HEAD |
|
NAS_HOST |
192.168.3.99 |
|
NAS_PATH |
/volume1/701项目组/006.研发补丁/ky_opsp[管理客户端]/ |
|
NAS_USER |
sparon |
|
DEPLOY_HOST |
192.168.6.221 |
|
DEPLOY_PATH |
/data/kuaiyu/ky_opsp |
|
DEPLOY_USER |
root |
|
DEPLOY_PASS |
112223 |
|
KuaiYu-Management-Web-Vite-Pug
基础配置
流水线配置:
version: 1.0
vars:
stages:
- stage:
displayName: build
name: build
steps:
- step: shell@sh
displayName: npm-build
name: build
env:
commands:
- yarn && yarn build
#- time=`date "+%Y%m%d%H%M%S"`
#- tar -czf ky_opsp-${time} ./dist/** && cp ky_opsp-$time.tar /root/
- tar zcvf ky_opsp.tar -C dist .
#- tar -czf ky_opsp-${{LAST_COMMIT_ID}}.tar ./dist/** && cp ky_opsp-${{LAST_COMMIT_ID}}.tar /root/
- scp ky_opsp.tar ${{NAS_USER}}@${{NAS_HOST}}:${{NAS_PATH}}/ky_opsp-`date "+%Y%m%d%H%M%S"`.tar
- scp ky_opsp.tar ${{DEPLOY_USER}}@${{DEPLOY_HOST}}:${{DEPLOY_PATH}}/web.tar
artifacts:
- scope: repo
repository: qffzbase
name: KY_OPSP
path: ./ky_opsp.tar
- step: shell@ssh
displayName: deploy-web
name: deploy
wait: [build]
input:
host: ${{DEPLOY_HOST}}:22
user: ${{DEPLOY_USER}}
pass: ${{DEPLOY_PASS}}
workspace: ${{DEPLOY_PATH}}
commands:
- pwd && ls
- rm -rf web/**
- tar zxvf web.tar -C web && rm -rf web.tar && ls
- cd ..
- pwd && ls
变量
触发器
字段名 |
值 |
触发器名称 |
Release |
触发器类型 |
webHook |
WebHook类型 |
Gitea |
密钥 |
e030f2d1-1112-4ce1-a581-fcfac9affc8c |
分支 |
master |
触发事件 |
push |
激活 |
是 |
制品库
KuaiYu-DS
基础配置
流水线配置:
version: 1.0
vars:
stages:
- stage:
displayName: build
name: build
steps:
- step: shell@sh
displayName: maven-clean
name: clean
env:
commands:
- mvn clean
- mvn install
- step: shell@sh
displayName: maven-test
name: test
env:
commands:
- mvn test -v
- step: shell@sh
displayName: maven-build
name: build
env:
commands:
- mvn build
变量
触发器
字段名 |
值 |
触发器名称 |
Release |
触发器类型 |
webHook |
WebHook类型 |
Gitea |
密钥 |
e030f2d1-1112-4ce1-a581-fcfac9affc8c |
分支 |
master |
触发事件 |
push |
激活 |
是 |
制品库