go_echo_wol/.drone.yml

52 lines
1.1 KiB
YAML
Raw Normal View History

2023-09-11 11:38:59 +08:00
# .drone.yml
kind: pipeline
name: default
steps:
- name: test
image: golang
commands:
2023-09-11 17:26:57 +08:00
- export GOPROXY=https://mirrors.aliyun.com/goproxy/
2023-09-11 11:38:59 +08:00
- go test
2023-09-11 17:17:53 +08:00
- name: clone_web
image: alpine/git
2023-09-11 16:59:25 +08:00
volumes:
2023-09-11 17:17:53 +08:00
- name: cache
path: /web
2023-09-11 16:59:25 +08:00
commands:
2023-09-11 17:34:08 +08:00
- pwd
2023-09-11 17:17:53 +08:00
- cd /web
- git clone https://git.shagain.club/lingling/go_echo_wol_web.git .
2023-09-11 16:59:25 +08:00
- git checkout master
2023-09-11 17:17:53 +08:00
- name: build_web
image: node
volumes:
- name: cache
path: /web
commands:
- cd /web/go_echo_wol_web
2023-09-11 16:59:25 +08:00
- npm install yarn
- cd go_echo_wol_web
- yarn
- yarn build
2023-09-11 11:38:59 +08:00
- name: build
image: golang
2023-09-11 16:59:25 +08:00
volumes:
2023-09-11 17:17:53 +08:00
- name: cache
path: /go
- name: outdir
host:
path: /root/web
2023-09-11 11:38:59 +08:00
commands:
2023-09-11 17:27:04 +08:00
- export GOPROXY=https://mirrors.aliyun.com/goproxy/
2023-09-11 16:59:25 +08:00
- rm -rf ./app/*
- cp -r /web/build ./app
- sed 's/\/static/\/static\/static/g' ./app/index.html
- sed 's/\/favicon.ico/\/static\/favicon.ico/g' ./app/index.html
- sed 's/\/logo192.png/\/static\/logo192.png/g' ./app/index.html
- sed 's/\/manifest.json/\/static\/manifest.json/g' ./app/index.html
- go build -o main
2023-09-11 17:17:53 +08:00
- cp main /root/web/