ci(other): ci脚本换源
This commit is contained in:
75
.drone.yml
75
.drone.yml
@@ -1,75 +0,0 @@
|
|||||||
kind: pipeline
|
|
||||||
type: docker
|
|
||||||
name: default
|
|
||||||
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: 测试服-构建部署
|
|
||||||
pull: if-not-exists
|
|
||||||
image: node:24-alpine
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- test
|
|
||||||
commands:
|
|
||||||
- npm install -g pnpm
|
|
||||||
- pnpm config set registry https://registry.npmmirror.com/
|
|
||||||
- pnpm install
|
|
||||||
- pnpm build:weapp:test:upload
|
|
||||||
- rm -rf dist.tar
|
|
||||||
|
|
||||||
- name: 正式服-构建部署
|
|
||||||
pull: if-not-exists
|
|
||||||
image: node:24-alpine
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
commands:
|
|
||||||
- npm install -g pnpm
|
|
||||||
- pnpm config set registry https://registry.npmmirror.com/
|
|
||||||
- pnpm install
|
|
||||||
- pnpm build:weapp:prod:upload
|
|
||||||
- rm -rf dist.tar
|
|
||||||
|
|
||||||
- name: 备用服-构建部署
|
|
||||||
pull: if-not-exists
|
|
||||||
image: node:24-alpine
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
commands:
|
|
||||||
- npm install -g pnpm
|
|
||||||
- pnpm config set registry https://registry.npmmirror.com/
|
|
||||||
- pnpm install
|
|
||||||
- pnpm build:weapp:reserve:upload
|
|
||||||
- rm -rf dist.tar
|
|
||||||
|
|
||||||
- name: 企业微信通知
|
|
||||||
pull: if-not-exists
|
|
||||||
image: plugins/webhook
|
|
||||||
when:
|
|
||||||
branch:
|
|
||||||
- test
|
|
||||||
- master
|
|
||||||
status:
|
|
||||||
- success
|
|
||||||
- failure
|
|
||||||
settings:
|
|
||||||
urls: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=a2065e21-4f92-4f5b-a432-2c0cd1d965b5
|
|
||||||
content_type: application/json
|
|
||||||
template: |
|
|
||||||
{
|
|
||||||
"msgtype": "markdown",
|
|
||||||
"markdown": {
|
|
||||||
"content": "{{#success build.status}}✅ 构建成功{{else}}❌ 构建失败{{/success}}\n
|
|
||||||
**项目**: {{ repo.owner }}/{{ repo.name }} (构建 #{{build.number}})\n
|
|
||||||
**分支**: {{ build.branch }}\n
|
|
||||||
**提交**: {{ build.commit }}\n
|
|
||||||
**作者**: {{ build.author }}\n
|
|
||||||
**信息**: {{ build.message }}\n
|
|
||||||
**耗时**: {{ since build.started }} 分钟\n
|
|
||||||
**详情**: [查看构建详情]({{ build.link }})"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -117,6 +117,7 @@ jobs:
|
|||||||
ACTOR: ${{ gitea.actor }}
|
ACTOR: ${{ gitea.actor }}
|
||||||
COMMIT_MSG: ${{ gitea.event.head_commit.message }}
|
COMMIT_MSG: ${{ gitea.event.head_commit.message }}
|
||||||
run: |
|
run: |
|
||||||
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories || true
|
||||||
apk add --no-cache curl jq
|
apk add --no-cache curl jq
|
||||||
EMOJI=$( [ "$STATUS" = "success" ] && echo "✅ 构建成功" || echo "❌ 构建失败" )
|
EMOJI=$( [ "$STATUS" = "success" ] && echo "✅ 构建成功" || echo "❌ 构建失败" )
|
||||||
MSG="$(printf "%s\n**项目**: %s (构建 #%s)\n**分支**: %s\n**提交**: %s\n**作者**: %s\n**信息**: %s\n**详情**: [查看构建详情](%s)" \
|
MSG="$(printf "%s\n**项目**: %s (构建 #%s)\n**分支**: %s\n**提交**: %s\n**作者**: %s\n**信息**: %s\n**详情**: [查看构建详情](%s)" \
|
||||||
|
|||||||
Reference in New Issue
Block a user