2023-09-11 11:38:59 +08:00
|
|
|
# .drone.yml
|
|
|
|
kind: pipeline
|
|
|
|
name: default
|
|
|
|
|
2023-09-12 09:44:14 +08:00
|
|
|
workspace:
|
|
|
|
base: /go
|
|
|
|
path: src/github.com/octocat/hello-world
|
|
|
|
|
2023-09-11 11:38:59 +08:00
|
|
|
steps:
|
2023-09-11 17:41:32 +08:00
|
|
|
- name: test
|
|
|
|
image: golang
|
|
|
|
commands:
|
|
|
|
- export GOPROXY=https://mirrors.aliyun.com/goproxy/
|
2023-09-11 17:43:54 +08:00
|
|
|
# - go test
|
2023-09-11 11:38:59 +08:00
|
|
|
|
2023-09-11 17:17:53 +08:00
|
|
|
- name: clone_web
|
|
|
|
image: alpine/git
|
2023-09-11 16:59:25 +08:00
|
|
|
commands:
|
2023-09-12 09:34:41 +08:00
|
|
|
- git clone https://git.shagain.club/lingling/go_echo_wol_web.git /go
|
2023-09-11 16:59:25 +08:00
|
|
|
- git checkout master
|
2023-09-11 17:17:53 +08:00
|
|
|
|
|
|
|
- name: build_web
|
|
|
|
image: node
|
|
|
|
commands:
|
2023-09-12 09:37:09 +08:00
|
|
|
- cd /go/
|
2023-09-11 16:59:25 +08:00
|
|
|
- npm install yarn
|
2023-09-11 17:39:58 +08:00
|
|
|
- yarn config set registry https://registry.npm.taobao.org --global
|
2023-09-11 16:59:25 +08:00
|
|
|
- yarn
|
|
|
|
- yarn build
|
|
|
|
|
2023-09-11 11:38:59 +08:00
|
|
|
- name: build
|
|
|
|
image: golang
|
2023-09-11 17:43:54 +08:00
|
|
|
volumes:
|
2023-09-11 17:17:53 +08:00
|
|
|
- name: outdir
|
|
|
|
host:
|
|
|
|
path: /root/web
|
2023-09-11 11:38:59 +08:00
|
|
|
commands:
|
2023-09-12 09:10:39 +08:00
|
|
|
- pwd
|
2023-09-11 16:59:25 +08:00
|
|
|
- rm -rf ./app/*
|
2023-09-12 09:44:14 +08:00
|
|
|
- cp -r /go//build ./app
|
2023-09-11 16:59:25 +08:00
|
|
|
- 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-12 08:55:36 +08:00
|
|
|
- cp main /root/web/
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
temp: {}
|