diff --git a/.drone.yml b/.drone.yml index 202bc09..57c511f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,33 +3,13 @@ type: docker name: default steps: - - name: restore cache - image: drillster/drone-volume-cache - settings: - restore: true - mount: - - go/pkg/mod - - ~/.cache/go-build - backend: local - cache_key: go-mod-cache-{{ branch }} - - name: build image: golang:1.22 commands: - go env -w GO111MODULE=on - go env -w GOPROXY=https://goproxy.cn,direct - go mod tidy - - go build -o main.exe . - - - name: rebuild cache - image: drillster/drone-volume-cache - settings: - rebuild: true - mount: - - go/pkg/mod - - ~/.cache/go-build - backend: local - cache_key: go-mod-cache-{{ branch }} + - go build -v -o main main.go - name: upload image: appleboy/drone-scp @@ -44,16 +24,13 @@ steps: - scripts/start.sh target: /opt/dockeropt/epic-go - # 可选:远程重启服务 - # - name: restart - # image: appleboy/ssh - # settings: - # host: 你的服务器IP或域名 - # username: 你的SSH用户名 - # password: - # from_secret: scp_password - # port: 22 - # script: - # - cd /your/deploy/path/ - # - chmod +x start.sh - # - ./start.sh \ No newline at end of file + - name: restart epic-go container + image: appleboy/ssh + settings: + host: 193.112.151.199 + username: root + password: + from_secret: scp_password + port: 222 + script: + - docker restart epic-go \ No newline at end of file