2020-09-01 12:31:28 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
2020-11-03 11:38:45 +00:00
|
|
|
name: build-amd64
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: amd64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: frontend
|
2021-05-20 07:56:37 +00:00
|
|
|
image: node:lts-alpine
|
2020-11-03 11:38:45 +00:00
|
|
|
commands:
|
2021-01-22 14:27:46 +00:00
|
|
|
- apk --no-cache add python2 build-base tar
|
2020-11-03 11:38:45 +00:00
|
|
|
- yarn config set network-timeout 100000
|
2021-05-04 14:48:16 +00:00
|
|
|
- yarn --cwd ui install
|
|
|
|
- tar --transform="s@.@./happydns-${DRONE_COMMIT}@" --exclude-vcs --exclude=./ui/node_modules/.cache -czf /dev/shm/happydns-src.tar.gz .
|
2021-01-22 14:27:46 +00:00
|
|
|
- mv /dev/shm/happydns-src.tar.gz .
|
2021-05-04 14:48:16 +00:00
|
|
|
- yarn --cwd ui --offline build
|
2020-11-03 11:38:45 +00:00
|
|
|
|
2021-01-22 14:27:46 +00:00
|
|
|
- name: deploy sources
|
|
|
|
image: appleboy/drone-scp
|
|
|
|
settings:
|
|
|
|
tar_tmp_path: /tmp/
|
|
|
|
host: get.happydns.org
|
|
|
|
target: /var/www/happydns.org/get/${DRONE_BRANCH//\//-}
|
|
|
|
source: happydns-src.tar.gz
|
|
|
|
username:
|
|
|
|
from_secret: ssh_username
|
|
|
|
key:
|
|
|
|
from_secret: deploy_key
|
|
|
|
port:
|
|
|
|
from_secret: ssh_port
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
- name: deploy sources for release
|
|
|
|
image: appleboy/drone-scp
|
|
|
|
settings:
|
|
|
|
tar_tmp_path: /tmp/
|
|
|
|
host: get.happydns.org
|
|
|
|
target: /var/www/happydns.org/get/${DRONE_TAG}
|
|
|
|
source: happydns-src.tar.gz
|
|
|
|
username:
|
|
|
|
from_secret: ssh_username
|
|
|
|
key:
|
|
|
|
from_secret: deploy_key
|
|
|
|
port:
|
|
|
|
from_secret: ssh_port
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
|
2020-11-03 11:38:45 +00:00
|
|
|
- name: backend
|
|
|
|
image: golang:alpine
|
|
|
|
commands:
|
2021-05-04 14:48:16 +00:00
|
|
|
- sed -i '/yarn --offline build/d' ui/assets.go
|
2020-11-08 19:50:02 +00:00
|
|
|
- go generate -v
|
2021-05-17 22:42:52 +00:00
|
|
|
- go build -v -tags netgo -ldflags '-w' -o happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
|
|
|
|
environment:
|
|
|
|
CGO_ENABLED: 0
|
2020-11-08 19:50:02 +00:00
|
|
|
|
2020-11-09 23:43:20 +00:00
|
|
|
- name: vet
|
|
|
|
image: golang:alpine
|
|
|
|
commands:
|
2020-11-10 01:13:03 +00:00
|
|
|
- apk --no-cache add build-base
|
2020-11-09 23:43:20 +00:00
|
|
|
- go vet -v
|
2021-05-17 22:42:52 +00:00
|
|
|
environment:
|
|
|
|
CGO_ENABLED: 0
|
2020-11-09 23:43:20 +00:00
|
|
|
|
2020-11-08 19:50:02 +00:00
|
|
|
- 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:
|
2021-05-17 22:42:52 +00:00
|
|
|
- go build -v -tags netgo -ldflags '-w' -o happydns-darwin-${DRONE_STAGE_ARCH}
|
2020-11-08 19:50:02 +00:00
|
|
|
environment:
|
2021-05-17 22:42:52 +00:00
|
|
|
CGO_ENABLED: 0
|
2020-11-08 19:50:02 +00:00
|
|
|
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
|
2020-11-03 11:38:45 +00:00
|
|
|
|
|
|
|
- name: publish
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
repo: happydns/happydns
|
|
|
|
auto_tag: true
|
|
|
|
auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
|
|
|
|
username:
|
|
|
|
from_secret: docker_username
|
|
|
|
password:
|
|
|
|
from_secret: docker_password
|
|
|
|
|
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: build-arm64
|
2020-09-01 12:31:28 +00:00
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: arm64
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: frontend
|
2021-05-20 07:56:37 +00:00
|
|
|
image: node:lts-alpine
|
2020-09-01 12:31:28 +00:00
|
|
|
commands:
|
|
|
|
- apk --no-cache add python2 build-base
|
|
|
|
- yarn config set network-timeout 100000
|
2021-05-04 14:48:16 +00:00
|
|
|
- yarn --cwd ui install
|
|
|
|
- yarn --cwd ui --offline build
|
2020-09-01 12:31:28 +00:00
|
|
|
|
|
|
|
- name: backend
|
|
|
|
image: golang:alpine
|
|
|
|
commands:
|
2021-05-04 14:48:16 +00:00
|
|
|
- sed -i '/yarn --offline build/d' ui/assets.go
|
2020-11-08 19:50:02 +00:00
|
|
|
- go generate -v
|
2021-05-17 22:42:52 +00:00
|
|
|
- go build -v -tags netgo -ldflags '-w' -o happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
|
2020-11-17 12:28:05 +00:00
|
|
|
- ln happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} happydns
|
2021-05-17 22:42:52 +00:00
|
|
|
environment:
|
|
|
|
CGO_ENABLED: 0
|
2020-11-08 19:50:02 +00:00
|
|
|
|
|
|
|
- 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
|
2020-11-03 11:38:45 +00:00
|
|
|
|
2021-05-17 22:43:11 +00:00
|
|
|
- name: build macOS
|
|
|
|
image: golang:alpine
|
|
|
|
commands:
|
|
|
|
- go build -v -tags netgo -ldflags '-w' -o happydns-darwin-${DRONE_STAGE_ARCH}
|
|
|
|
environment:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
GOOS: darwin
|
|
|
|
GOARCH: arm64
|
|
|
|
|
|
|
|
- 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
|
|
|
|
|
2020-11-03 11:38:45 +00:00
|
|
|
- name: publish
|
|
|
|
image: plugins/docker
|
|
|
|
settings:
|
|
|
|
repo: happydns/happydns
|
|
|
|
auto_tag: true
|
|
|
|
auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
|
2020-11-17 12:28:05 +00:00
|
|
|
dockerfile: Dockerfile-builded
|
2020-11-03 11:38:45 +00:00
|
|
|
username:
|
|
|
|
from_secret: docker_username
|
|
|
|
password:
|
|
|
|
from_secret: docker_password
|
|
|
|
|
2020-11-08 19:55:31 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: build-arm
|
|
|
|
|
|
|
|
platform:
|
|
|
|
os: linux
|
|
|
|
arch: arm
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: frontend
|
2021-05-20 07:56:37 +00:00
|
|
|
image: node:lts-alpine
|
2020-11-08 19:55:31 +00:00
|
|
|
commands:
|
|
|
|
- apk --no-cache add python2 build-base
|
|
|
|
- yarn config set network-timeout 100000
|
2021-05-04 14:48:16 +00:00
|
|
|
- yarn --cwd ui install
|
|
|
|
- yarn --cwd ui --offline build
|
2020-11-08 19:55:31 +00:00
|
|
|
|
|
|
|
- name: backend armel
|
|
|
|
image: golang:alpine
|
|
|
|
commands:
|
2021-05-04 14:48:16 +00:00
|
|
|
- apk --no-cache add build-base
|
|
|
|
- sed -i '/yarn --offline build/d' ui/assets.go
|
2020-11-08 19:55:31 +00:00
|
|
|
- go generate -v
|
2021-05-17 22:42:52 +00:00
|
|
|
- go build -v -tags netgo -ldflags '-w' -o happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}el
|
2020-11-08 19:55:31 +00:00
|
|
|
environment:
|
2021-05-17 22:42:52 +00:00
|
|
|
CGO_ENABLED: 0
|
2020-11-08 19:55:31 +00:00
|
|
|
GOARM: 5
|
|
|
|
|
|
|
|
- name: deploy armel
|
|
|
|
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}el
|
|
|
|
username:
|
|
|
|
from_secret: ssh_username
|
|
|
|
key:
|
|
|
|
from_secret: deploy_key
|
|
|
|
port:
|
|
|
|
from_secret: ssh_port
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
- name: deploy armel 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}el
|
|
|
|
username:
|
|
|
|
from_secret: ssh_username
|
|
|
|
key:
|
|
|
|
from_secret: deploy_key
|
|
|
|
port:
|
|
|
|
from_secret: ssh_port
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
|
|
|
|
- name: backend armhf
|
|
|
|
image: golang:alpine
|
|
|
|
commands:
|
2020-11-10 01:13:03 +00:00
|
|
|
- apk --no-cache add build-base
|
2021-05-17 22:42:52 +00:00
|
|
|
- go build -v -tags netgo -ldflags '-w' -o happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}hf
|
2020-11-08 19:55:31 +00:00
|
|
|
environment:
|
2021-05-17 22:42:52 +00:00
|
|
|
CGO_ENABLED: 0
|
2020-11-08 19:55:31 +00:00
|
|
|
GOARM: 6
|
|
|
|
|
|
|
|
- name: deploy armhf
|
|
|
|
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}hf
|
|
|
|
username:
|
|
|
|
from_secret: ssh_username
|
|
|
|
key:
|
|
|
|
from_secret: deploy_key
|
|
|
|
port:
|
|
|
|
from_secret: ssh_port
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
- name: deploy armhf 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}hf
|
|
|
|
username:
|
|
|
|
from_secret: ssh_username
|
|
|
|
key:
|
|
|
|
from_secret: deploy_key
|
|
|
|
port:
|
|
|
|
from_secret: ssh_port
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
|
|
|
|
- name: backend armv7
|
|
|
|
image: golang:alpine
|
|
|
|
commands:
|
2020-11-10 01:13:03 +00:00
|
|
|
- apk --no-cache add build-base
|
2021-05-17 22:42:52 +00:00
|
|
|
- go build -v -tags netgo -ldflags '-w' -o happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7
|
2020-11-17 12:28:05 +00:00
|
|
|
- ln happydns-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7 happydns
|
2020-11-08 19:55:31 +00:00
|
|
|
environment:
|
2021-05-17 22:42:52 +00:00
|
|
|
CGO_ENABLED: 0
|
2020-11-08 19:55:31 +00:00
|
|
|
GOARM: 7
|
|
|
|
|
|
|
|
- name: deploy armv7
|
|
|
|
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}v7
|
|
|
|
username:
|
|
|
|
from_secret: ssh_username
|
|
|
|
key:
|
|
|
|
from_secret: deploy_key
|
|
|
|
port:
|
|
|
|
from_secret: ssh_port
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
|
|
|
|
- name: deploy armv7 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}v7
|
|
|
|
username:
|
|
|
|
from_secret: ssh_username
|
|
|
|
key:
|
|
|
|
from_secret: deploy_key
|
|
|
|
port:
|
|
|
|
from_secret: ssh_port
|
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- tag
|
|
|
|
|
2020-11-17 12:28:05 +00:00
|
|
|
- name: publish
|
2021-02-10 02:34:51 +00:00
|
|
|
image: plugins/docker:linux-arm
|
2020-11-17 12:28:05 +00:00
|
|
|
settings:
|
|
|
|
repo: happydns/happydns
|
|
|
|
auto_tag: true
|
|
|
|
auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
|
|
|
|
dockerfile: Dockerfile-builded
|
|
|
|
username:
|
|
|
|
from_secret: docker_username
|
|
|
|
password:
|
|
|
|
from_secret: docker_password
|
|
|
|
|
2020-11-03 11:38:45 +00:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
name: docker-manifest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: publish
|
|
|
|
image: plugins/manifest
|
|
|
|
settings:
|
|
|
|
auto_tag: true
|
|
|
|
ignore_missing: true
|
|
|
|
spec: .drone-manifest.yml
|
|
|
|
username:
|
|
|
|
from_secret: docker_username
|
|
|
|
password:
|
|
|
|
from_secret: docker_password
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
event:
|
|
|
|
- push
|
|
|
|
- tag
|
|
|
|
|
|
|
|
depends_on:
|
|
|
|
- build-amd64
|
|
|
|
- build-arm64
|