idfm-api/.drone.yml

62 lines
1.3 KiB
YAML
Raw Normal View History

2022-10-23 14:56:22 +00:00
---
kind: pipeline
type: docker
name: build-arm
platform:
os: linux
arch: arm64
2022-10-23 14:56:22 +00:00
workspace:
base: /go
path: src/git.nemunai.re/nemunaire/idfm-api
steps:
- name: build
image: golang:1-alpine
commands:
- mkdir deploy
- apk --no-cache add build-base git
- go get -v -d
- go vet -v
- go build -v -ldflags '-w -X main.Version="${DRONE_BRANCH}-${DRONE_COMMIT}" -X main.build=${DRONE_BUILD_NUMBER}' -o idfm-api-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
- ln idfm-api-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} deploy/idfm-api
environment:
CGO_ENABLED: 0
when:
event:
exclude:
- tag
- name: build tag
image: golang:1-alpine
commands:
- mkdir deploy
- apk --no-cache add build-base git
- go get -v -d
- go vet -v
- go build -v -ldflags '-w -X main.Version="${DRONE_TAG##v}" -X main.build=${DRONE_BUILD_NUMBER}' -o idfm-api-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}
- ln idfm-api-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH} deploy/idfm-api
environment:
CGO_ENABLED: 0
when:
event:
- tag
- name: docker
image: plugins/docker
2022-10-23 14:56:22 +00:00
settings:
registry: registry.nemunai.re
repo: registry.nemunai.re/idfm-api
auto_tag: true
2022-10-23 14:56:22 +00:00
username:
from_secret: docker_username
password:
from_secret: docker_password
2022-10-23 14:56:22 +00:00
trigger:
event:
- cron
- push
- tag