kind: pipeline type: docker name: master clone: disable: true steps: - name: clone image: drone/git commands: - echo "172.31.211.15 git.oa00.com" >> /etc/hosts - git clone $DRONE_REMOTE_URL . - git checkout $DRONE_COMMIT - name: build image: golang:1.16-alpine3.13 environment: GOMODCACHE: '/drone/src/mod.pkg' commands: # - GOPROXY=https://goproxy.cn go get -u github.com/go-bindata/go-bindata/...@v3.1.2 - GOPROXY=https://goproxy.cn CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X recook/configs.environment=release" -tags=jsoniter -v -o ./recook ./main.go - name: scp files image: appleboy/drone-scp settings: host: 47.100.87.70 username: from_secret: pro_user password: from_secret: pro_pass port: 22 target: /root source: ./recook - name: ssh image: appleboy/drone-ssh settings: host: 47.100.87.70 username: from_secret: pro_user password: from_secret: pro_pass port: 22 script: - cd /root - ./update_recook.sh volumes: - name: cache host: path: "/tmp/cache" trigger: branch: - master event: - push - merge --- kind: pipeline type: docker name: test clone: disable: true steps: - name: clone image: drone/git commands: - echo "172.31.211.15 git.oa00.com" >> /etc/hosts - git clone $DRONE_REMOTE_URL . - git checkout $DRONE_COMMIT - name: build image: golang:1.16-alpine3.13 environment: GOMODCACHE: '/drone/src/mod.pkg' commands: # - GOPROXY=https://goproxy.cn go get -u github.com/go-bindata/go-bindata/...@v3.1.2 - GOPROXY=https://goproxy.cn CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X recook/configs.environment=debug" -tags=jsoniter -v -o ./recook ./main.go - name: scp files image: appleboy/drone-scp settings: host: 139.196.147.232 username: from_secret: test_user password: from_secret: test_pass port: 22 target: /root source: ./recook - name: ssh image: appleboy/drone-ssh settings: host: 139.196.147.232 username: from_secret: test_user password: from_secret: test_pass port: 22 script: - cd /root - ./update_recook.sh volumes: - name: cache host: path: "/tmp/cache" trigger: branch: - test event: - push - merge