go_echo_wol/.drone.yml

38 lines
866 B
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:
- go test
2023-09-11 16:59:25 +08:00
- name: clone_build_web
image: node
volumes:
- name: bulid-workspace
2023-09-11 16:59:38 +08:00
path: /root/web
2023-09-11 16:59:25 +08:00
commands:
- git clone https://git.shagain.club/lingling/go_echo_wol_web.git
- git checkout master
- npm install yarn
- cd go_echo_wol_web
- yarn
- yarn build
2023-09-11 16:59:38 +08:00
- cp -r ./build /root/web/build
2023-09-11 16:59:25 +08:00
2023-09-11 11:38:59 +08:00
- name: build
image: golang
2023-09-11 16:59:25 +08:00
volumes:
- name: bulid-workspace
2023-09-11 16:59:38 +08:00
path: /root/web
2023-09-11 11:38:59 +08:00
commands:
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 16:59:38 +08:00
- cp main /root/web/build/