happyDomain/.drone.yml

659 lines
15 KiB
YAML

---
kind: pipeline
type: docker
name: build-amd64
platform:
os: linux
arch: amd64
steps:
- name: frontend
image: node:14-alpine
commands:
- apk --no-cache add python2 build-base tar
- yarn config set network-timeout 100000
- yarn --cwd ui install
- 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 .
- yarn --cwd ui --offline build
- name: deploy sources
image: plugins/s3
settings:
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
branch:
exclude:
- renovate/*
- name: deploy sources for release
image: plugins/s3
settings:
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
image: golang:1-alpine
commands:
- sed -i '/yarn --offline build/d' ui/assets.go
- go generate -v
- go build -v -tags netgo -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
image: golang:1-alpine
commands:
- sed -i '/yarn --offline build/d' ui/assets.go
- go generate -v
- go build -v -tags netgo -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
image: golang:1-alpine
commands:
- apk --no-cache add build-base
- go vet -v
environment:
CGO_ENABLED: 0
- name: deploy
image: plugins/s3
settings:
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
branch:
exclude:
- renovate/*
- name: deploy release
image: plugins/s3
settings:
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
image: golang:1-alpine
commands:
- go build -v -tags netgo -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
image: golang:1-alpine
commands:
- go build -v -tags netgo -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
image: plugins/s3
settings:
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
branch:
exclude:
- renovate/*
- name: deploy macOS release
image: plugins/s3
settings:
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 local registry
image: plugins/docker
settings:
registry: registry.happydomain.org
repo: registry.happydomain.org/happydomain
auto_tag: true
auto_tag_suffix: ${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
username:
from_secret: docker_username
password:
from_secret: docker_password
- name: publish on Docker Hub
image: plugins/docker
settings:
repo: happydns/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
platform:
os: linux
arch: arm64
steps:
- name: frontend
image: node:14-alpine
commands:
- apk --no-cache add python2 build-base
- yarn config set network-timeout 100000
- yarn --cwd ui install
- yarn --cwd ui --offline build
- name: backend-commit
image: golang:1-alpine
commands:
- sed -i '/yarn --offline build/d' ui/assets.go
- go generate -v
- go build -v -tags netgo -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
image: golang:1-alpine
commands:
- sed -i '/yarn --offline build/d' ui/assets.go
- go generate -v
- go build -v -tags netgo -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: deploy
image: plugins/s3
settings:
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
branch:
exclude:
- renovate/*
- name: deploy release
image: plugins/s3
settings:
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
image: golang:1-alpine
commands:
- go build -v -tags netgo -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: arm64
when:
event:
exclude:
- tag
- name: build-tag macOS
image: golang:1-alpine
commands:
- go build -v -tags netgo -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
- name: deploy macOS
image: plugins/s3
settings:
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
branch:
exclude:
- renovate/*
- name: deploy macOS release
image: plugins/s3
settings:
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 local registry
image: plugins/docker
settings:
registry: registry.happydomain.org
repo: registry.happydomain.org/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
- name: publish on Docker Hub
image: plugins/docker
settings:
repo: happydns/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-arm
platform:
os: linux
arch: arm
steps:
- name: frontend
image: node:14-alpine
commands:
- apk --no-cache add python2 build-base
- yarn config set network-timeout 100000
- yarn --cwd ui install
- yarn --cwd ui --offline build
- name: backend-commit armel
image: golang:1-alpine
commands:
- apk --no-cache add build-base
- sed -i '/yarn --offline build/d' ui/assets.go
- go generate -v
- go build -v -tags netgo -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
- name: backend-tag armel
image: golang:1-alpine
commands:
- apk --no-cache add build-base
- sed -i '/yarn --offline build/d' ui/assets.go
- go generate -v
- go build -v -tags netgo -ldflags '-w -X main.version="${DRONE_TAG##v}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}el
environment:
CGO_ENABLED: 0
GOARM: 5
when:
event:
- tag
- name: deploy armel
image: plugins/s3
settings:
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//\//-}/
when:
event:
- push
branch:
exclude:
- renovate/*
- name: deploy armel release
image: plugins/s3
settings:
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}/
when:
event:
- tag
- name: backend-commit armhf
image: golang:1-alpine
commands:
- apk --no-cache add build-base
- go build -v -tags netgo -ldflags '-w -X main.version="${DRONE_BRANCH}-${DRONE_COMMIT}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}hf
environment:
CGO_ENABLED: 0
GOARM: 6
when:
event:
exclude:
- tag
- name: backend-tag armhf
image: golang:1-alpine
commands:
- apk --no-cache add build-base
- go build -v -tags netgo -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
- name: deploy armhf
image: plugins/s3
settings:
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//\//-}/
when:
event:
- push
branch:
exclude:
- renovate/*
- name: deploy armhf release
image: plugins/s3
settings:
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}/
when:
event:
- tag
- name: backend-commit armv7
image: golang:1-alpine
commands:
- apk --no-cache add build-base
- go build -v -tags netgo -ldflags '-w -X main.version="${DRONE_BRANCH}-${DRONE_COMMIT}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7
- ln happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7 happydomain
environment:
CGO_ENABLED: 0
GOARM: 7
when:
event:
exclude:
- tag
- name: backend-tag armv7
image: golang:1-alpine
commands:
- apk --no-cache add build-base
- go build -v -tags netgo -ldflags '-w -X main.version="${DRONE_TAG##v}" -X main.build=${DRONE_BUILD_NUMBER}' -o happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7
- ln happydomain-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}v7 happydomain
environment:
CGO_ENABLED: 0
GOARM: 7
when:
event:
- tag
- name: deploy armv7
image: plugins/s3
settings:
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//\//-}/
when:
event:
- push
branch:
exclude:
- renovate/*
- name: deploy armv7 release
image: plugins/s3
settings:
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}/
when:
event:
- tag
- name: publish on local registry
image: plugins/docker
settings:
registry: registry.happydomain.org
repo: registry.happydomain.org/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
- name: publish on Docker Hub
image: plugins/docker
settings:
repo: happydns/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
name: docker-manifest
steps:
- name: publish on local registry
image: plugins/manifest
settings:
auto_tag: true
ignore_missing: true
spec: .drone-manifest-local.yml
username:
from_secret: docker_username
password:
from_secret: docker_password
- 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
- build-arm