You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.2 KiB

4 years ago
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
3 years ago
- GOPROXY=https://goproxy.cn CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-X recook/configs.environment=release" -tags=jsoniter -v -o ./recook_v2 ./main.go
4 years ago
- name: scp files
image: appleboy/drone-scp
settings:
3 years ago
host: 120.55.167.78
4 years ago
username:
from_secret: pro_user
password:
from_secret: pro_pass
port: 22
target: /root
3 years ago
source: ./recook_v2
4 years ago
- name: ssh
image: appleboy/drone-ssh
settings:
3 years ago
host: 120.55.167.78
4 years ago
username:
from_secret: pro_user
password:
from_secret: pro_pass
port: 22
script:
- cd /root
3 years ago
- ./update_recook_v2.sh
4 years ago
volumes:
- name: cache
host:
path: "/tmp/cache"
trigger:
branch:
- master
3 years ago
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
# Do stuff..
- name: build
image: golang:1.16-alpine3.13
environment:
GOMODCACHE: '/drone/src/mod.pkg'
commands:
- GOPROXY=https://goproxy.cn GOSUMDB=off CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags "-X recook/configs.environment=debug" -tags=jsoniter -v -o ./bin/server ./main.go
- name: docker
image: plugins/docker
settings:
dockerfile: "Dockerfile.drone"
repo: harbor.oa00.com/reecook/backend
registry: harbor.oa00.com
username:
from_secret: docker_username
password:
from_secret: docker_password
tags:
- latest
trigger:
branch:
- test
4 years ago
event:
- push
- merge