Merge remote-tracking branch 'origin/master'
# Conflicts: # .drone.yml
This commit is contained in:
76
.drone.yml
76
.drone.yml
@@ -3,34 +3,60 @@ type: docker
|
|||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: restore cache
|
||||||
|
image: drillster/drone-volume-cache
|
||||||
|
volumes:
|
||||||
|
- name: go-mod-cache
|
||||||
|
path: /opt/drone/cache/go-mod
|
||||||
|
- name: go-build-cache
|
||||||
|
path: /opt/drone/cache/go-build
|
||||||
|
settings:
|
||||||
|
restore: true
|
||||||
|
mount:
|
||||||
|
- /opt/drone/cache/go-mod
|
||||||
|
- /opt/drone/cache/go-build
|
||||||
|
backend: local
|
||||||
|
cache_key: go-mod-cache-${DRONE_BRANCH}
|
||||||
|
|
||||||
- name: build
|
- name: build
|
||||||
image: golang:1.22
|
image: golang:1.22
|
||||||
commands:
|
commands:
|
||||||
- go env -w GO111MODULE=on
|
- mkdir -p /opt/drone/cache/go-mod
|
||||||
- go env -w GOPROXY=https://goproxy.cn,direct
|
- echo "drone test" > /opt/drone/cache/go-mod/drone_testfile
|
||||||
- go mod tidy
|
- ls -lR /opt/drone/cache/go-mod
|
||||||
- go build -v -o main main.go
|
|
||||||
|
|
||||||
- name: upload
|
- name: rebuild cache
|
||||||
image: appleboy/drone-scp
|
image: drillster/drone-volume-cache
|
||||||
|
volumes:
|
||||||
|
- name: go-mod-cache
|
||||||
|
path: /opt/drone/cache/go-mod
|
||||||
|
- name: go-build-cache
|
||||||
|
path: /opt/drone/cache/go-build
|
||||||
settings:
|
settings:
|
||||||
host: 193.112.151.199
|
rebuild: true
|
||||||
username: root
|
mount:
|
||||||
password:
|
- /opt/drone/cache/go-mod
|
||||||
from_secret: scp_password
|
- /opt/drone/cache/go-build
|
||||||
port: 222
|
backend: local
|
||||||
source:
|
cache_key: go-mod-cache-${DRONE_BRANCH}
|
||||||
- main.exe
|
|
||||||
- scripts/start.sh
|
|
||||||
target: /opt/dockeropt/epic-go
|
|
||||||
|
|
||||||
- name: restart epic-go container
|
# 可选:远程重启服务
|
||||||
image: appleboy/ssh
|
# - name: restart
|
||||||
settings:
|
# image: appleboy/ssh
|
||||||
host: 193.112.151.199
|
# settings:
|
||||||
username: root
|
# host: 你的服务器IP或域名
|
||||||
password:
|
# username: 你的SSH用户名
|
||||||
from_secret: scp_password
|
# password:
|
||||||
port: 222
|
# from_secret: scp_password
|
||||||
script:
|
# port: 22
|
||||||
- docker restart epic-go
|
# script:
|
||||||
|
# - cd /your/deploy/path/
|
||||||
|
# - chmod +x start.sh
|
||||||
|
# - ./start.sh
|
||||||
|
volumes:
|
||||||
|
- name: go-mod-cache
|
||||||
|
host:
|
||||||
|
path: /opt/drone/cache/go-mod
|
||||||
|
- name: go-build-cache
|
||||||
|
host:
|
||||||
|
path: /opt/drone/cache/go-build
|
||||||
Reference in New Issue
Block a user