ekster/.drone.yml
Peter Stuifzand bac33043c1
Some checks failed
continuous-integration/drone/push Build is failing
Add static and promotion of builds
2021-11-20 20:57:49 +01:00

81 lines
1.5 KiB
YAML

---
kind: pipeline
type: docker
name: build
workspace:
base: /go
path: src/p83.nl/go/ekster
steps:
- name: testing
image: golang:1.16-alpine
environment:
CGO_ENABLED: 0
GOOS: linux
GOARCH: amd64
commands:
- apk --no-cache add git
- go get -d -t ./...
- go install honnef.co/go/tools/cmd/staticcheck@latest
- go build p83.nl/go/ekster/cmd/eksterd
- go vet ./...
- go test -v ./...
- staticcheck ./...
---
kind: pipeline
type: docker
name: deploy
depends_on:
- build
workspace:
base: /go
path: src/p83.nl/go/ekster
steps:
- name: publish-personal
image: plugins/docker
settings:
repo: registry.stuifzandapp.com/microsub-server
registry: registry.stuifzandapp.com
username:
from_secret: docker_username
password:
from_secret: docker_password
# - name: publish-docker
# image: plugins/docker
# depends_on:
# - testing
# settings:
# repo: pstuifzand/ekster
# tags:
# - alpine
# username:
# from_secret: docker_official_username
# password:
# from_secret: docker_official_password
- name: deploy
image: appleboy/drone-ssh
depends_on:
- publish-personal
settings:
host: microsub.stuifzandapp.com
username: microsub
ssh_key:
from_secret: ssh_key
script:
- cd /home/microsub/microsub
- docker-compose pull web
- docker-compose up -d
trigger:
event:
- promote
target:
- production