Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

Commit

Permalink
adapt .drone.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
PatWie committed May 5, 2019
1 parent d5e5031 commit 5319015
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 11 deletions.
13 changes: 13 additions & 0 deletions .docker/fmt/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang:alpine

WORKDIR /workdir

RUN apk add --no-cache --virtual .build-deps \
git \
; \
go get golang.org/x/tools/cmd/goimports && \
rm -rf /go/src/golang.org \
apk del .build-deps;

WORKDIR /drone/src
# ENTRYPOINT ["goimports"]
4 changes: 4 additions & 0 deletions .docker/fmt/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.PHONY: run

build:
sudo docker build . -t patwie/goimports:v1
34 changes: 23 additions & 11 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ platform:
arch: amd64

steps:
- name: fmt
pull: default
image: patwie/goimports:v1
commands:
- "[ 0 -eq `goimports -l . | wc -l` ]"

- name: lint
image: golangci/golangci-lint:v1.16
pull: true
commands:
- golangci-lint run -D errcheck --deadline=10m

- name: build
pull: default
image: golang
commands:
- sed -i 's/"X-INFOMARK-VERSION", "0.0.1"/"X-INFOMARK-VERSION", "${DRONE_COMMIT_SHA}"/g' api/app/router.go
- go version
- go build infomark.go
environment:
GOPROXY: https://gomods.patwie.com/

- name: ping_db
pull: default
image: postgres:11.2-alpine
Expand Down Expand Up @@ -45,16 +67,6 @@ steps:
- "PGPASSWORD=postgres psql -h 'database' -U 'postgres' -d 'infomark' -f migrations/0.0.1alpha21.sql >/dev/null"
- "PGPASSWORD=postgres psql -h 'database' -U 'postgres' -d 'infomark' -f mock.sql >/dev/null"

- name: build
pull: default
image: golang
commands:
- sed -i 's/"X-INFOMARK-VERSION", "0.0.1"/"X-INFOMARK-VERSION", "${DRONE_COMMIT_SHA}"/g' api/app/router.go
- go version
- go build infomark.go
environment:
GOPROXY: https://gomods.patwie.com/

- name: test
pull: default
image: golang
Expand Down Expand Up @@ -114,6 +126,6 @@ services:

---
kind: signature
hmac: 96c71a82796008f906b69d1e50a485b8efc22262fa0a0d6dad330d9d5b6f0575
hmac: bec11f987bcc8b10e923674bbb63e983c274ee5b007d2f2ae9a703f8f6e829cd

...

0 comments on commit 5319015

Please sign in to comment.