Skip to content

Commit

Permalink
Merge pull request #17 from Clever/drone-to-circle
Browse files Browse the repository at this point in the history
Drone to CircleCI and update golang.mk
  • Loading branch information
peggyl authored Jan 27, 2017
2 parents 51c45cb + b117502 commit a4551dd
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 28 deletions.
25 changes: 0 additions & 25 deletions .drone.yml

This file was deleted.

22 changes: 22 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
machine:
post:
- cd $HOME && git clone --depth 1 -v [email protected]:clever/ci-scripts.git && cd ci-scripts && git show --oneline -s
- $HOME/ci-scripts/circleci/golang-install 1.7
services:
- docker
checkout:
post:
- $HOME/ci-scripts/circleci/golang-move-project
test:
override:
- make test
post:
- $HOME/ci-scripts/circleci/report-card $RC_DOCKER_USER $RC_DOCKER_PASS "$RC_DOCKER_EMAIL" $RC_GITHUB_TOKEN
deployment:
all:
branch: master
owner: Clever
commands:
- make release && $HOME/ci-scripts/circleci/github-release $GH_RELEASE_TOKEN release
general:
build_dir: ../.go_workspace/src/github.com/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME
14 changes: 11 additions & 3 deletions golang.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# This is the default Clever Golang Makefile.
# Please do not alter this file directly.
GOLANG_MK_VERSION := 0.1.0
GOLANG_MK_VERSION := 0.1.3

SHELL := /bin/bash
.PHONY: golang-godep-vendor golang-test-deps $(GODEP)

# if the gopath includes several directories, use only the first
GOPATH=$(shell echo $$GOPATH | cut -d: -f1)

# This block checks and confirms that the proper Go toolchain version is installed.
# arg1: golang version
define golang-version-check
Expand Down Expand Up @@ -63,7 +66,7 @@ golang-lint-deps: $(GOLINT)
# arg1: pkg path
define golang-lint
@echo "LINTING $(1)..."
@$(GOLINT) $(GOPATH)/src/$(1)/*.go
@find $(GOPATH)/src/$(1)/*.go -type f | grep -v gen_ | xargs $(GOLINT)
endef

# golang-lint-deps-strict requires the golint tool for golang linting.
Expand All @@ -74,7 +77,7 @@ golang-lint-deps-strict: $(GOLINT) $(FGT)
# arg1: pkg path
define golang-lint-strict
@echo "LINTING $(1)..."
@$(FGT) $(GOLINT) $(GOPATH)/src/$(1)/*.go
@find $(GOPATH)/src/$(1)/*.go -type f | grep -v gen_ | xargs $(FGT) $(GOLINT)
endef

# golang-test-deps is here for consistency
Expand Down Expand Up @@ -131,3 +134,8 @@ $(call golang-lint-strict,$(1))
$(call golang-vet,$(1))
$(call golang-test-strict,$(1))
endef

# golang-update-makefile downloads latest version of golang.mk
golang-update-makefile:
@wget https://raw.githubusercontent.com/Clever/dev-handbook/master/make/golang.mk -O /tmp/golang.mk 2>/dev/null
@if ! grep -q $(GOLANG_MK_VERSION) /tmp/golang.mk; then cp /tmp/golang.mk golang.mk && echo "golang.mk updated"; else echo "golang.mk is up-to-date"; fi

0 comments on commit a4551dd

Please sign in to comment.