6 Star 10 Fork 14

jianmu-runners/jianmu-runner-list

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
qiniu.yml 5.03 KB
一键复制 编辑 原始数据 按行查看 历史
daihw 提交于 2023-05-12 09:45 +08:00 . refactor: auto_build_image升级至1.0.2
name: 发布七牛云api节点
global:
param:
# 格式:docker.jianmuhub.com/jianmurunner/${节点定义唯一标识}
image_name: docker.jianmuhub.com/jianmurunner/qiniu
trigger:
type: webhook
param:
- name: gitee_token
type: SECRET
exp: $.header.X-Gitee-Token
- name: gitee_event
type: STRING
exp: $.header.X-Gitee-Event
- name: gitee_tag_created
type: BOOL
exp: $.body.json.created
- name: gitee_ref
type: STRING
exp: $.body.json.ref
auth:
token: ${trigger.gitee_token}
value: ((gitee.webhook_runner_token))
only: (${trigger.gitee_event} === "Tag Push Hook" && ${trigger.gitee_tag_created})
workflow:
start:
alias: 开始
type: start
targets:
- git_clone
git_clone:
type: git_clone:1.2.0
sources:
- start
targets:
- nodejs_build
- string
param:
remote_url: https://gitee.com/jianmu-runners/jianmu-runner-qiniu.git
ref: ${trigger.gitee_ref}
username: ((gitee.username))
password: ((gitee.password))
nodejs_build:
type: "nodejs_build:1.2.1-16.13.0"
sources:
- git_clone
targets:
- pack_tar
param:
workspace: ${git_clone.git_path}
registry_url: https://registry.npm.taobao.org
build_arg: --mode cdn
pack_tar:
type: "pack_tar:1.0.1"
sources:
- nodejs_build
targets:
- string_branch
param:
cmd: "tar -zcvf ${git_clone.git_path}/scripts/node_modules.tar.gz -C ${git_clone.git_path} node_modules"
string_branch:
type: string:1.0.0-nodejs16.13.1
sources:
- pack_tar
targets:
- git_push
param:
expression: >
let pushBranch = '';
pushBranch = (function a () {
// domain_ssl_update
if ('${git_clone.git_tag}'.includes('domain-ssl-update')) {
return '${trigger.gitee_ref}'.split('/')['${trigger.gitee_ref}'.split('/').length - 1].slice(-17).replaceAll('-','_')
}else if('${git_clone.git_tag}'.includes('file-upload')){
return '${trigger.gitee_ref}'.split('/')['${trigger.gitee_ref}'.split('/').length - 1].slice(-11).replaceAll('-','_')
}else if('${git_clone.git_tag}'.includes('ssl-upload')){
return '${trigger.gitee_ref}'.split('/')['${trigger.gitee_ref}'.split('/').length - 1].slice(-10).replaceAll('-','_')
}
}())
git_push:
sources:
- string_branch
targets:
- auto_build_image
type: "git_push:1.0.6"
param:
username: ((gitee.fh_username))
password: ((gitee.fh_password))
remote_url: https://gitee.com/jianmu-runners/jianmu-runner-qiniu.git
remote_branch: ${string_branch.result}
source_path: "${git_clone.git_path}/scripts"
target_dir: "jianmu-runner-qiniu/scripts"
commit_message: "push node_modules"
string:
type: string:1.0.0-nodejs16.13.1
sources:
- git_clone
targets:
- auto_build_image
param:
expression: >
let buildId = '';
buildId = (function a () {
// domain_ssl_update
if ('${git_clone.git_tag}'.includes('domain-ssl-update')) {
return '223d90ca-f0b1-4dc6-81e6-5097a2009fa4';
}else if('${git_clone.git_tag}'.includes('file-upload')){
return 'ec77255a-aa25-4ca9-a498-658ee337e92d';
}else if('${git_clone.git_tag}'.includes('ssl-upload')){
return 'a51e4ab8-6c6e-47d8-a3de-355852791689';
}
}())
auto_build_image:
type: auto_build_image:1.0.2
sources:
- git_push
- string
targets:
- hub_publish
param:
api_url: https://api.jianmuhub.com/open
access_token: ((jianmu_image.fh_token))
tag: ${git_clone.git_tag}
# 修改构建计划页面URL中获取
build_plan_id: ${string.result}
hub_publish:
type: hub_publish:1.1.0
sources:
- auto_build_image
targets:
- send_message
param:
hub_url: https://api.jianmuhub.com
dsl_file_path: ${git_clone.git_path}/dsl/qiniu.yml
hub_api_ak: ((jianmuhub.ak))
hub_api_sk: ((jianmuhub.sk))
version: ${git_clone.git_tag}
image: ${global.image_name}:${git_clone.git_tag}
send_message:
type: feishu_notice_interactive:1.0.4
sources:
- hub_publish
targets:
- send_email
param:
bot_webhook_url: ((feishu.webhook_url))
msg_title: 已发布七牛云api节点。
msg_markdown: "版本:${git_clone.git_tag}\n作者:[comyan](https://gitee.com/comyan)"
send_email:
type: email:1.0.1
sources:
- send_message
targets:
- end
param:
host: smtp.ym.163.com
sender: notice@jianmu.dev
auth_code: ((email.notice_auth_code))
receivers: '["dev@jianmu.dev"]'
type: html
subject: 节点发布通知-qiniu:${git_clone.git_tag}
text: 已发布七牛云api节点。<br/>版本:${git_clone.git_tag}<br/>作者:<a href="https://gitee.com/comyan">comyan</a>
end:
alias: 结束
type: end
sources:
- send_email
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jianmu-runners/jianmu-runner-list.git
git@gitee.com:jianmu-runners/jianmu-runner-list.git
jianmu-runners
jianmu-runner-list
jianmu-runner-list
master

搜索帮助