CD: deploy binaries for macOS, linux-arm64 and linux-amd64
This commit is contained in:
parent
6ac93962c6
commit
4c8677e74d
118
.drone.yml
118
.drone.yml
|
@ -21,8 +21,84 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- apk --no-cache add go-bindata
|
- apk --no-cache add go-bindata
|
||||||
- sed -i '/yarn --cwd htdocs --offline build/d' static.go
|
- sed -i '/yarn --cwd htdocs --offline build/d' static.go
|
||||||
- go generate
|
- go generate -v
|
||||||
- go build
|
- go build -v -o happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
|
||||||
|
|
||||||
|
- name: deploy
|
||||||
|
image: appleboy/drone-scp
|
||||||
|
settings:
|
||||||
|
tar_tmp_path: /tmp/
|
||||||
|
host: get.happydns.org
|
||||||
|
target: /var/www/happydns.org/get/${DRONE_BRANCH//\//-}
|
||||||
|
source: happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
|
||||||
|
username:
|
||||||
|
from_secret: ssh_username
|
||||||
|
key:
|
||||||
|
from_secret: deploy_key
|
||||||
|
port:
|
||||||
|
from_secret: ssh_port
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
- name: deploy release
|
||||||
|
image: appleboy/drone-scp
|
||||||
|
settings:
|
||||||
|
tar_tmp_path: /tmp/
|
||||||
|
host: get.happydns.org
|
||||||
|
target: /var/www/happydns.org/get/${DRONE_TAG}
|
||||||
|
source: happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
|
||||||
|
username:
|
||||||
|
from_secret: ssh_username
|
||||||
|
key:
|
||||||
|
from_secret: deploy_key
|
||||||
|
port:
|
||||||
|
from_secret: ssh_port
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
- name: build macOS
|
||||||
|
image: golang:alpine
|
||||||
|
commands:
|
||||||
|
- go build -v -o happydns-darwin-${DRONE_STAGE_ARCH}
|
||||||
|
environment:
|
||||||
|
GOOS: darwin
|
||||||
|
GOARCH: amd64
|
||||||
|
|
||||||
|
- name: deploy macOS
|
||||||
|
image: appleboy/drone-scp
|
||||||
|
settings:
|
||||||
|
tar_tmp_path: /tmp/
|
||||||
|
host: get.happydns.org
|
||||||
|
target: /var/www/happydns.org/get/${DRONE_BRANCH//\//-}
|
||||||
|
source: happydns-darwin-${DRONE_STAGE_ARCH}
|
||||||
|
username:
|
||||||
|
from_secret: ssh_username
|
||||||
|
key:
|
||||||
|
from_secret: deploy_key
|
||||||
|
port:
|
||||||
|
from_secret: ssh_port
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
- name: deploy macOS release
|
||||||
|
image: appleboy/drone-scp
|
||||||
|
settings:
|
||||||
|
tar_tmp_path: /tmp/
|
||||||
|
host: get.happydns.org
|
||||||
|
target: /var/www/happydns.org/get/${DRONE_TAG}
|
||||||
|
source: happydns-darwin-${DRONE_STAGE_ARCH}
|
||||||
|
username:
|
||||||
|
from_secret: ssh_username
|
||||||
|
key:
|
||||||
|
from_secret: deploy_key
|
||||||
|
port:
|
||||||
|
from_secret: ssh_port
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
- name: publish
|
- name: publish
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
|
@ -58,8 +134,42 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- apk --no-cache add go-bindata
|
- apk --no-cache add go-bindata
|
||||||
- sed -i '/yarn --cwd htdocs --offline build/d' static.go
|
- sed -i '/yarn --cwd htdocs --offline build/d' static.go
|
||||||
- go generate
|
- go generate -v
|
||||||
- go build
|
- go build -v -o happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
|
||||||
|
|
||||||
|
- name: deploy
|
||||||
|
image: appleboy/drone-scp
|
||||||
|
settings:
|
||||||
|
tar_tmp_path: /tmp/
|
||||||
|
host: get.happydns.org
|
||||||
|
target: /var/www/happydns.org/get/${DRONE_BRANCH//\//-}
|
||||||
|
source: happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
|
||||||
|
username:
|
||||||
|
from_secret: ssh_username
|
||||||
|
key:
|
||||||
|
from_secret: deploy_key
|
||||||
|
port:
|
||||||
|
from_secret: ssh_port
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
|
||||||
|
- name: deploy release
|
||||||
|
image: appleboy/drone-scp
|
||||||
|
settings:
|
||||||
|
tar_tmp_path: /tmp/
|
||||||
|
host: get.happydns.org
|
||||||
|
target: /var/www/happydns.org/get/${DRONE_TAG}
|
||||||
|
source: happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
|
||||||
|
username:
|
||||||
|
from_secret: ssh_username
|
||||||
|
key:
|
||||||
|
from_secret: deploy_key
|
||||||
|
port:
|
||||||
|
from_secret: ssh_port
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
- name: publish
|
- name: publish
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
|
|
Loading…
Reference in New Issue