This commit is contained in:
曾志威
2026-09-24 11:54:15 +08:00
parent b1db1dedd1
commit 095b7f8c56
5 changed files with 131 additions and 52 deletions
+46 -21
View File
@@ -1,6 +1,11 @@
kind: pipeline
type: docker
name: default
platform:
os: linux
arch: amd64
environment:
http_proxy: http://192.168.9.1:7893
https_proxy: http://192.168.9.1:7893
@@ -39,24 +44,44 @@ steps:
test "$(git rev-parse HEAD)" = "$DRONE_COMMIT_SHA" || { echo 'Checked out commit does not match this build'; exit 1; }
git log -1 --format='Checked out commit: %H'
# docker 打包
- name: docker
image: plugins/docker
settings:
context: ./
dockerfile: ./Dockerfile
build_args_from_env:
- http_proxy
- https_proxy
- no_proxy
- HTTP_PROXY
- HTTPS_PROXY
- NO_PROXY
username:
from_secret: docker_username
password:
from_secret: docker_password
registry: https://registry.cn-hangzhou.aliyuncs.com
repo: registry.cn-hangzhou.aliyuncs.com/hub_z/webproxy
tags:
- latest
- name: frontend-build
image: node:22.19.0-alpine
commands:
- npm --prefix web ci --no-audit --no-fund
- npm --prefix web run build
- name: build-binaries
image: golang:1.25.0-alpine
environment:
GOTOOLCHAIN: go1.25.0
CGO_ENABLED: "0"
commands:
- apk add --no-cache git
- sh scripts/build-ci-release.sh
- name: package
image: node:22.19.0-alpine
commands:
- apk add --no-cache libarchive-tools curl
- node --test scripts/ci-release.test.mjs
- node scripts/verify-package.mjs bin/build-cache/ci-release/linux-amd64/serviceport
- node scripts/ci-release.mjs package
- name: upload-ipfs
image: node:22.19.0-alpine
environment:
IPFS_API: https://ipfs.freeicu.top
IPFS_TOKEN: "674d69308edc52450a5fff0e64947703de3d47d723810b53833ec9d4e999f20e"
commands:
- apk add --no-cache curl
- node scripts/ci-release.mjs upload
when:
event:
- push
- tag
trigger:
event:
- push
- pull_request
- tag