Add .drone.yml file for drone CI

This commit is contained in:
Lucas BEE 2019-04-14 14:31:22 +02:00
parent 209773e244
commit 87bd2cb8e1
2 changed files with 46 additions and 2 deletions

45
.drone.yml Normal file
View File

@ -0,0 +1,45 @@
kind: pipeline
name: default
steps:
- name: prepare-workdir
image: alpine:3.9
commands:
- mkdir canapeapp
- name: frontend
image: node:12.2
commands:
- npm install yarn
- yarn install
- yarn build
- name: backend
image: golang:1.12.4
commands:
- GO111MODULE=off go get -tags 'postgres' -u github.com/golang-migrate/migrate/cmd/migrate
- cp $$GOPATH/bin/migrate migrate
- go build -v -o canapeapp/app backend/*.go
- name: prepare-docker
image: alpine:3.9
commands:
- cp docker/run.sh canapeapp/run.sh
- cp migrate canapeapp/migrate
- cp -R migrations canapeapp/migrations
- name: docker
image: plugins/docker
settings:
repo: odwrtw/canapeapp
dockerfile: docker/Dockerfile-production
tags: latest
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
branch:
- master
event:
- push

View File

@ -25,8 +25,7 @@ go tools:
```
go get -v -u github.com/pilu/fresh
go get -v -u github.com/mattes/migrate
go build -tags 'postgres' -o $GOPATH/bin/migrate github.com/mattes/migrate/cli
GO111MODULE=off go get -tags 'postgres' -u github.com/golang-migrate/migrate/cmd/migrate
```
## Dev