49 lines
1.0 KiB
YAML
49 lines
1.0 KiB
YAML
# .drone.yml
|
|
kind: pipeline
|
|
name: default
|
|
|
|
workspace:
|
|
base: /go
|
|
path: src/github.com/octocat/hello-world
|
|
|
|
steps:
|
|
- name: test
|
|
image: golang
|
|
commands:
|
|
- export GOPROXY=https://mirrors.aliyun.com/goproxy/
|
|
# - go test
|
|
|
|
- name: clone_web
|
|
image: alpine/git
|
|
commands:
|
|
- git clone https://git.shagain.club/lingling/go_echo_wol_web.git /go
|
|
- git checkout master
|
|
|
|
- name: build_web
|
|
image: node
|
|
commands:
|
|
- cd /go/
|
|
- npm install yarn
|
|
- yarn config set registry https://registry.npm.taobao.org --global
|
|
- yarn
|
|
- yarn build
|
|
|
|
- name: build
|
|
image: golang
|
|
volumes:
|
|
- name: outdir
|
|
host:
|
|
path: /root/web
|
|
commands:
|
|
- pwd
|
|
- rm -rf ./app/*
|
|
- cp -r /go//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
|
|
- cp main /root/web/
|
|
volumes:
|
|
- name: cache
|
|
temp: {} |