2021-11-20 19:57:49 +00:00
|
|
|
---
|
2019-03-19 21:23:10 +00:00
|
|
|
kind: pipeline
|
2021-10-20 20:06:59 +00:00
|
|
|
type: docker
|
2021-11-20 19:57:49 +00:00
|
|
|
name: build
|
2018-02-16 21:13:01 +00:00
|
|
|
|
2019-03-19 21:23:10 +00:00
|
|
|
workspace:
|
|
|
|
base: /go
|
|
|
|
path: src/p83.nl/go/ekster
|
2019-01-12 15:42:29 +00:00
|
|
|
|
2022-04-20 11:22:06 +00:00
|
|
|
services:
|
|
|
|
- name: redis
|
|
|
|
image: redis:5
|
|
|
|
- name: database
|
|
|
|
image: postgres:14
|
|
|
|
environment:
|
|
|
|
POSTGRES_DB: ekster_testing
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_PASSWORD: simple
|
|
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
|
|
|
2019-03-19 21:23:10 +00:00
|
|
|
steps:
|
|
|
|
- name: testing
|
2022-04-16 13:05:22 +00:00
|
|
|
image: golang:1.18-alpine
|
2019-08-06 22:07:45 +00:00
|
|
|
environment:
|
|
|
|
CGO_ENABLED: 0
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: amd64
|
2019-03-19 21:23:10 +00:00
|
|
|
commands:
|
2022-04-16 13:05:22 +00:00
|
|
|
- go version
|
2019-03-19 21:23:10 +00:00
|
|
|
- apk --no-cache add git
|
|
|
|
- go get -d -t ./...
|
2022-04-20 11:22:06 +00:00
|
|
|
- go build -buildvcs=false p83.nl/go/ekster/cmd/eksterd
|
2021-11-20 19:57:49 +00:00
|
|
|
- go vet ./...
|
|
|
|
- go test -v ./...
|
2019-03-19 21:23:10 +00:00
|
|
|
|
2019-07-23 18:34:51 +00:00
|
|
|
- name: publish-personal
|
2019-03-19 21:23:10 +00:00
|
|
|
image: plugins/docker
|
2021-11-20 20:50:58 +00:00
|
|
|
depends_on:
|
|
|
|
- testing
|
2019-03-19 21:23:10 +00:00
|
|
|
settings:
|
|
|
|
repo: registry.stuifzandapp.com/microsub-server
|
|
|
|
registry: registry.stuifzandapp.com
|
|
|
|
username:
|
|
|
|
from_secret: docker_username
|
|
|
|
password:
|
|
|
|
from_secret: docker_password
|
2021-11-20 20:47:07 +00:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- production
|
2019-03-19 21:23:10 +00:00
|
|
|
|
2021-10-30 23:38:17 +00:00
|
|
|
# - 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
|
2019-07-23 18:34:51 +00:00
|
|
|
|
2019-03-19 21:23:10 +00:00
|
|
|
- name: deploy
|
|
|
|
image: appleboy/drone-ssh
|
2021-10-20 20:06:59 +00:00
|
|
|
depends_on:
|
|
|
|
- publish-personal
|
2019-03-19 21:23:10 +00:00
|
|
|
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
|
2021-11-20 20:47:07 +00:00
|
|
|
when:
|
|
|
|
event:
|
|
|
|
- promote
|
|
|
|
target:
|
|
|
|
- production
|