Compare commits

..

7 Commits

Author SHA1 Message Date
65c5c7880a 更新 .drone.yml
Some checks failed
continuous-integration/drone/push Build is failing
2025-04-18 21:00:23 +08:00
giaogiao
4f511cd99a 测试drone runner节点能否运行
Some checks failed
continuous-integration/drone/push Build is failing
2023-11-21 17:02:02 +08:00
giaogiao
6f4439ece2 🐎 ci(drone.yaml): 修改drone ci钉钉通知插件
从lddsb/drone-dingtalk-message修改为guoxudongdocker/drone-dingtalk docker镜像通知
2023-11-21 16:53:07 +08:00
giaogiao
1699d455b5 前端更新 触发重新打包
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-27 17:25:02 +08:00
giaogiao
7b9d006142 修改钉钉通知
All checks were successful
continuous-integration/drone/push Build is passing
2023-09-26 11:06:51 +08:00
giaogiao
2ded913541 不切换git分支
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2023-09-26 10:09:30 +08:00
giaogiao
1a00ad754f 关闭钉钉通知的调试
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-09-26 10:01:16 +08:00
2 changed files with 67 additions and 71 deletions

View File

@ -1,4 +1,3 @@
# .drone.yml
kind: pipeline kind: pipeline
name: default name: default
@ -6,33 +5,36 @@ workspace:
base: /go base: /go
path: src/github.com/octocat/hello-world path: src/github.com/octocat/hello-world
volumes:
- name: outdir
host:
path: /root/web
steps: steps:
- name: test - name: test
image: golang image: golang:1.21
environment:
GOPROXY: https://mirrors.aliyun.com/goproxy/
commands: commands:
- export GOPROXY=https://mirrors.aliyun.com/goproxy/ - go mod tidy
- go test - go test ./...
- name: clone_web - name: clone_web
image: alpine/git image: alpine/git
commands: commands:
- mkdir /go/web
- ls /go/web
- git clone https://git.shagain.club/lingling/go_echo_wol_web.git /go/web - git clone https://git.shagain.club/lingling/go_echo_wol_web.git /go/web
- git checkout master
- name: build_web - name: build_web
image: node image: node:18-alpine
commands: commands:
- cd /go/web/ - cd /go/web/
- npm install yarn
- yarn config set registry https://registry.npm.taobao.org --global - yarn config set registry https://registry.npm.taobao.org --global
- yarn - yarn install
- sed -i 's?(dev_ws_url)?(wsurl)?g' ./src/api/websocket.js - sed -i 's?(dev_ws_url)?(wsurl)?g' ./src/api/websocket.js
- yarn build - yarn build
- name: build - name: build_go_app
image: golang:bullseye image: golang:1.21-bullseye
volumes: volumes:
- name: outdir - name: outdir
path: /root/web path: /root/web
@ -44,37 +46,30 @@ steps:
- sed -i 's?/favicon.ico?/static/favicon.ico?g' ./app/index.html - sed -i 's?/favicon.ico?/static/favicon.ico?g' ./app/index.html
- sed -i 's?/logo192.png?/static/logo192.png?g' ./app/index.html - sed -i 's?/logo192.png?/static/logo192.png?g' ./app/index.html
- sed -i 's?/manifest.json?/static/manifest.json?g' ./app/index.html - sed -i 's?/manifest.json?/static/manifest.json?g' ./app/index.html
- apt update -y && apt install build-essential -y - apt update && apt install -y build-essential
- bash bulid.sh - bash bulid.sh
- name: 打包Docker镜像并推送 - name: docker_build_push
image: plugins/docker image: plugins/docker
settings: settings:
repo: linglingking/go_wol_web repo: linglingking/go_wol_web
use_cache: true use_cache: true
auto_tag: true
username: username:
from_secret: docker_name from_secret: docker_name
password: password:
from_secret: docker_password from_secret: docker_password
auto_tag: true # 自动打tag
# 也可以用下面这个手动指定
# tags:
# - latest
# - 0.0.1
when: when:
event: push event: push
branch: master branch: master
- name: 钉钉通知 - name: dingtalk_notify
image: lddsb/drone-dingtalk-message image: guoxudongdocker/drone-dingtalk
settings: settings:
token: e53b19defd95a6f27ca766051b3ba047328760b0bbcd7c9fb6e74bc33635eb07 token: e53b19defd95a6f27ca766051b3ba047328760b0bbcd7c9fb6e74bc33635eb07
type: markdown type: markdown
secret: SECad13514bd7dee3fa73eeec19c32cfa2495a0f94976162f8534af956be30870e4 message_color: true
debug: true message_pic: true
sha_link: true
when: when:
status: [failure, success] status: [ failure, success ]
volumes:
- name: outdir
host:
path: /root/web

View File

@ -47,4 +47,5 @@ do
# CGO_ENABLED=0 GOOS=${array[0]} GOARCH=${array[1]} go build -o /root/web/${array[0]}_${array[1]}_main${extension} # CGO_ENABLED=0 GOOS=${array[0]} GOARCH=${array[1]} go build -o /root/web/${array[0]}_${array[1]}_main${extension}
CGO_ENABLED=1 GOOS=${array[0]} GOARCH=${array[1]} go build -ldflags "-linkmode external -extldflags '-static' -s -w" -o ${array[0]}_${array[1]}_main${extension} CGO_ENABLED=1 GOOS=${array[0]} GOARCH=${array[1]} go build -ldflags "-linkmode external -extldflags '-static' -s -w" -o ${array[0]}_${array[1]}_main${extension}
cp ${array[0]}_${array[1]}_main${extension} /root/web/ cp ${array[0]}_${array[1]}_main${extension} /root/web/
done done