happyDomain/.drone.yml

634 lines
15 KiB
YAML
Raw Permalink Normal View History

2020-09-01 12:31:28 +00:00
---
kind: pipeline
type: docker
name: build-amd64
platform:
os: linux
arch: amd64
steps:
- name: frontend
2023-11-14 09:15:59 +00:00
image: node:21-alpine
commands:
2023-01-11 12:32:57 +00:00
- apk --no-cache add tar
- yarn config set network-timeout 100000
2021-05-04 14:48:16 +00:00
- yarn --cwd ui install
2022-01-10 13:06:19 +00:00
- tar --transform="s@.@./happydomain-${DRONE_COMMIT}@" --exclude-vcs --exclude=./ui/node_modules/.cache -czf /dev/shm/happydomain-src.tar.gz .
- mv /dev/shm/happydomain-src.tar.gz .
2021-05-04 14:48:16 +00:00
- yarn --cwd ui --offline build
- name: deploy sources
2022-01-10 13:06:19 +00:00
image: plugins/s3
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-src.tar.gz
target: /${DRONE_BRANCH//\//-}/
when:
event:
- push
2022-03-14 23:28:16 +00:00
branch:
exclude:
- renovate/*
- name: deploy sources for release
2022-01-10 13:06:19 +00:00
image: plugins/s3
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-src.tar.gz
target: /${DRONE_TAG}/
when:
event:
- tag
- name: backend-commit
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
commands:
2022-03-20 02:07:35 +00:00
- apk add --no-cache git
- sed -i '/npm run build/d' ui/assets.go
2023-08-05 16:15:52 +00:00
- go install github.com/swaggo/swag/cmd/swag@latest
2023-05-20 10:43:32 +00:00
- go generate -v ./...
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_BRANCH}-${DRONE_COMMIT}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
- ln happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} happydomain
environment:
CGO_ENABLED: 0
when:
event:
exclude:
- tag
- name: backend-tag
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
commands:
2022-03-20 02:07:35 +00:00
- apk add --no-cache git
- sed -i '/npm run build/d' ui/assets.go
2023-08-05 16:15:52 +00:00
- go install github.com/swaggo/swag/cmd/swag@latest
2023-05-20 10:43:32 +00:00
- go generate -v ./...
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X main.Version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
- ln happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} happydomain
environment:
CGO_ENABLED: 0
when:
event:
- tag
- name: vet and tests
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
2020-11-09 23:43:20 +00:00
commands:
2022-03-20 02:07:35 +00:00
- apk --no-cache add build-base git
2023-05-20 10:43:32 +00:00
- go vet -v ./...
- go test -v ./...
environment:
CGO_ENABLED: 0
2020-11-09 23:43:20 +00:00
- name: deploy
2022-01-10 13:06:19 +00:00
image: plugins/s3
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
target: /${DRONE_BRANCH//\//-}/
when:
event:
- push
2022-03-14 23:28:16 +00:00
branch:
exclude:
- renovate/*
- name: deploy release
2022-01-10 13:06:19 +00:00
image: plugins/s3
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
target: /${DRONE_TAG}/
when:
event:
- tag
- name: build-commit macOS
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
commands:
2022-03-20 02:07:35 +00:00
- apk add --no-cache git
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_BRANCH}-${DRONE_COMMIT}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-darwin-${DRONE_STAGE_ARCH}
environment:
CGO_ENABLED: 0
GOOS: darwin
GOARCH: amd64
when:
event:
exclude:
- tag
- name: build-tag macOS
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
commands:
2022-03-20 02:07:35 +00:00
- apk add --no-cache git
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_TAG##v}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-darwin-${DRONE_STAGE_ARCH}
environment:
CGO_ENABLED: 0
GOOS: darwin
GOARCH: amd64
when:
event:
- tag
- name: deploy macOS
2022-01-10 13:06:19 +00:00
image: plugins/s3
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-darwin-${DRONE_STAGE_ARCH}
target: /${DRONE_BRANCH//\//-}/
when:
event:
- push
2022-03-14 23:28:16 +00:00
branch:
exclude:
- renovate/*
- name: deploy macOS release
2022-01-10 13:06:19 +00:00
image: plugins/s3
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-darwin-${DRONE_STAGE_ARCH}
target: /${DRONE_TAG}/
when:
event:
- tag
- name: publish on Docker Hub
image: plugins/docker
settings:
repo: happydomain/happydomain
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
trigger:
event:
- cron
- push
- tag
---
kind: pipeline
type: docker
name: build-arm64
2020-09-01 12:31:28 +00:00
platform:
os: linux
arch: arm64
steps:
- name: frontend
2023-11-14 09:15:59 +00:00
image: node:21-alpine
2020-09-01 12:31:28 +00:00
commands:
2023-01-11 12:32:57 +00:00
- cd ui
- npm install --network-timeout=100000
- npm run build
2020-09-01 12:31:28 +00:00
- name: backend-commit
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
commands:
2022-03-20 02:07:35 +00:00
- apk add --no-cache git
- sed -i '/npm run build/d' ui/assets.go
2023-08-05 16:15:52 +00:00
- go install github.com/swaggo/swag/cmd/swag@latest
2023-05-20 10:43:32 +00:00
- go generate -v ./...
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_BRANCH}-${DRONE_COMMIT}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
2022-01-10 13:06:19 +00:00
- ln happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} happydomain
environment:
CGO_ENABLED: 0
when:
event:
exclude:
- tag
- name: backend-tag
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
2020-09-01 12:31:28 +00:00
commands:
2022-03-20 02:07:35 +00:00
- apk add --no-cache git
- sed -i '/npm run build/d' ui/assets.go
2023-08-05 16:15:52 +00:00
- go install github.com/swaggo/swag/cmd/swag@latest
2023-05-20 10:43:32 +00:00
- go generate -v ./...
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X main.Version=${DRONE_TAG##v} -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
2022-01-10 13:06:19 +00:00
- ln happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} happydomain
environment:
CGO_ENABLED: 0
when:
event:
- tag
- name: deploy
2022-01-10 13:06:19 +00:00
image: plugins/s3
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
target: /${DRONE_BRANCH//\//-}/
when:
event:
- push
2022-03-14 23:28:16 +00:00
branch:
exclude:
- renovate/*
- name: deploy release
2022-01-10 13:06:19 +00:00
image: plugins/s3
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
target: /${DRONE_TAG}/
when:
event:
- tag
- name: build-commit macOS
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
2021-05-17 22:43:11 +00:00
commands:
2022-03-20 02:07:35 +00:00
- apk add --no-cache git
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_BRANCH}-${DRONE_COMMIT}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-darwin-${DRONE_STAGE_ARCH}
2021-05-17 22:43:11 +00:00
environment:
CGO_ENABLED: 0
GOOS: darwin
GOARCH: arm64
when:
event:
exclude:
- tag
- name: build-tag macOS
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
commands:
2022-03-20 02:07:35 +00:00
- apk add --no-cache git
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_TAG##v}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-darwin-${DRONE_STAGE_ARCH}
environment:
CGO_ENABLED: 0
GOOS: darwin
GOARCH: arm64
when:
event:
- tag
2021-05-17 22:43:11 +00:00
- name: deploy macOS
2022-01-10 13:06:19 +00:00
image: plugins/s3
2021-05-17 22:43:11 +00:00
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-darwin-${DRONE_STAGE_ARCH}
target: /${DRONE_BRANCH//\//-}/
2021-05-17 22:43:11 +00:00
when:
event:
- push
2022-03-14 23:28:16 +00:00
branch:
exclude:
- renovate/*
2021-05-17 22:43:11 +00:00
- name: deploy macOS release
2022-01-10 13:06:19 +00:00
image: plugins/s3
2021-05-17 22:43:11 +00:00
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-darwin-${DRONE_STAGE_ARCH}
target: /${DRONE_TAG}/
2021-05-17 22:43:11 +00:00
when:
event:
- tag
- name: publish on Docker Hub
image: plugins/docker
settings:
repo: happydomain/happydomain
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
trigger:
event:
- cron
- push
- tag
2020-11-08 19:55:31 +00:00
---
kind: pipeline
type: docker
name: build-arm
platform:
os: linux
arch: arm
steps:
- name: frontend
2024-01-09 09:25:45 +00:00
image: node:21
2020-11-08 19:55:31 +00:00
commands:
2023-01-11 12:32:57 +00:00
- cd ui
- npm install --network-timeout=100000
- npm run build
2020-11-08 19:55:31 +00:00
- name: backend-commit armel
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
commands:
2022-03-20 02:07:35 +00:00
- apk --no-cache add build-base git
- sed -i '/npm run build/d' ui/assets.go
2023-08-05 16:15:52 +00:00
- go install github.com/swaggo/swag/cmd/swag@latest
2023-05-20 10:43:32 +00:00
- go generate -v ./...
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_BRANCH}-${DRONE_COMMIT}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}el
environment:
CGO_ENABLED: 0
GOARM: 5
when:
event:
exclude:
- tag
branch:
exclude:
- renovate/*
- name: backend-tag armel
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
2020-11-08 19:55:31 +00:00
commands:
2022-03-20 02:07:35 +00:00
- apk --no-cache add build-base git
- sed -i '/npm run build/d' ui/assets.go
2023-08-05 16:15:52 +00:00
- go install github.com/swaggo/swag/cmd/swag@latest
2023-05-20 10:43:32 +00:00
- go generate -v ./...
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_TAG##v}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}el
2020-11-08 19:55:31 +00:00
environment:
CGO_ENABLED: 0
2020-11-08 19:55:31 +00:00
GOARM: 5
when:
event:
- tag
2020-11-08 19:55:31 +00:00
- name: deploy armel
2023-01-10 18:44:44 +00:00
image: plugins/s3:linux-arm
2020-11-08 19:55:31 +00:00
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}el
target: /${DRONE_BRANCH//\//-}/
2020-11-08 19:55:31 +00:00
when:
event:
- push
2022-03-14 23:28:16 +00:00
branch:
exclude:
- renovate/*
2020-11-08 19:55:31 +00:00
- name: deploy armel release
2023-01-10 18:44:44 +00:00
image: plugins/s3:linux-arm
2020-11-08 19:55:31 +00:00
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}el
target: /${DRONE_TAG}/
2020-11-08 19:55:31 +00:00
when:
event:
- tag
- name: backend-commit armhf
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
2020-11-08 19:55:31 +00:00
commands:
2022-03-20 02:07:35 +00:00
- apk --no-cache add build-base git
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_BRANCH}-${DRONE_COMMIT}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}hf
2020-11-08 19:55:31 +00:00
environment:
CGO_ENABLED: 0
2020-11-08 19:55:31 +00:00
GOARM: 6
when:
event:
exclude:
- tag
branch:
exclude:
- renovate/*
- name: backend-tag armhf
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
commands:
2022-03-20 02:07:35 +00:00
- apk --no-cache add build-base git
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_TAG##v}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}hf
environment:
CGO_ENABLED: 0
GOARM: 6
when:
event:
- tag
2020-11-08 19:55:31 +00:00
- name: deploy armhf
2023-01-10 18:44:44 +00:00
image: plugins/s3:linux-arm
2020-11-08 19:55:31 +00:00
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}hf
target: /${DRONE_BRANCH//\//-}/
2020-11-08 19:55:31 +00:00
when:
event:
- push
2022-03-14 23:28:16 +00:00
branch:
exclude:
- renovate/*
2020-11-08 19:55:31 +00:00
- name: deploy armhf release
2023-01-10 18:44:44 +00:00
image: plugins/s3:linux-arm
2020-11-08 19:55:31 +00:00
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}hf
target: /${DRONE_TAG}/
2020-11-08 19:55:31 +00:00
when:
event:
- tag
- name: backend-commit armv7
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
2020-11-08 19:55:31 +00:00
commands:
2022-03-20 02:07:35 +00:00
- apk --no-cache add build-base git
2023-09-19 08:16:21 +00:00
- "[ -f docs/docs.go ] || sed -i '/npm run build/d' ui/assets.go"
- "[ -f docs/docs.go ] || go install github.com/swaggo/swag/cmd/swag@latest"
- "[ -f docs/docs.go ] || go generate -v ./..."
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_BRANCH}-${DRONE_COMMIT}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7
2022-01-10 13:06:19 +00:00
- ln happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7 happydomain
2020-11-08 19:55:31 +00:00
environment:
CGO_ENABLED: 0
2020-11-08 19:55:31 +00:00
GOARM: 7
when:
event:
exclude:
- tag
- name: backend-tag armv7
2021-11-01 09:35:18 +00:00
image: golang:1-alpine
commands:
2022-03-20 02:07:35 +00:00
- apk --no-cache add build-base git
- go build -v -tags listmonk,netgo,swagger,ui -ldflags '-w -X "main.Version=${DRONE_TAG##v}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7
2022-01-10 13:06:19 +00:00
- ln happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7 happydomain
environment:
CGO_ENABLED: 0
GOARM: 7
when:
event:
- tag
2020-11-08 19:55:31 +00:00
- name: deploy armv7
2023-01-10 18:44:44 +00:00
image: plugins/s3:linux-arm
2020-11-08 19:55:31 +00:00
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7
target: /${DRONE_BRANCH//\//-}/
2020-11-08 19:55:31 +00:00
when:
event:
- push
2022-03-14 23:28:16 +00:00
branch:
exclude:
- renovate/*
2020-11-08 19:55:31 +00:00
- name: deploy armv7 release
2023-01-10 18:44:44 +00:00
image: plugins/s3:linux-arm
2020-11-08 19:55:31 +00:00
settings:
2022-01-10 13:06:19 +00:00
endpoint: https://storage0.nemunai.re
path_style: true
bucket: happydomain-dl
access_key:
from_secret: s3_access_key
secret_key:
from_secret: s3_secret_key
source: happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7
target: /${DRONE_TAG}/
2020-11-08 19:55:31 +00:00
when:
event:
- tag
- name: publish on Docker Hub
2023-01-18 18:40:42 +00:00
image: plugins/docker:linux-arm
settings:
repo: happydomain/happydomain
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
trigger:
branch:
- master
event:
- cron
- push
- tag
---
kind: pipeline
name: docker-manifest
steps:
- name: publish on Docker Hub
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:
- cron
- push
- tag
depends_on:
- build-amd64
- build-arm64
2022-01-10 13:06:19 +00:00
- build-arm