Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit b9f947d

Browse files
authored
Merge pull request #1610 from codysoyland/circleci
Add CircleCI
2 parents b7c9726 + 9717dd2 commit b9f947d

File tree

2 files changed

+107
-2
lines changed

2 files changed

+107
-2
lines changed

.circleci/config.yml

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
version: 2
2+
defaults: &defaults
3+
working_directory: /go/src/github.com/pilosa/pilosa
4+
docker:
5+
- image: circleci/golang:1.10
6+
fast-checkout: &fast-checkout
7+
attach_workspace:
8+
at: .
9+
jobs:
10+
build:
11+
<<: *defaults
12+
steps:
13+
- checkout
14+
- restore_cache:
15+
keys:
16+
- vendor-cache-{{ checksum "Gopkg.lock" }}
17+
- run: "[ -d vendor ] || make vendor"
18+
- save_cache:
19+
key: vendor-cache-{{ checksum "Gopkg.lock" }}
20+
paths:
21+
- vendor
22+
- persist_to_workspace:
23+
root: .
24+
paths: "*"
25+
linter:
26+
<<: *defaults
27+
steps:
28+
- *fast-checkout
29+
- run: go get -u github.com/alecthomas/gometalinter
30+
- run: gometalinter --install
31+
- run: go get github.com/remyoudompheng/go-misc/deadcode
32+
- run: make gometalinter
33+
test-golang-1.10: &base-test
34+
<<: *defaults
35+
steps:
36+
- *fast-checkout
37+
- run: sudo apt-get install lsof
38+
- run: make test
39+
test-golang-1.11-rc:
40+
<<: *base-test
41+
docker:
42+
- image: circleci/golang:1.11-rc
43+
test-golang-1.10-386:
44+
<<: *base-test
45+
environment:
46+
GOARCH: 386
47+
prerelease:
48+
<<: *base-test
49+
steps:
50+
- *fast-checkout
51+
- run: make prerelease
52+
- store_artifacts:
53+
path: build
54+
- persist_to_workspace:
55+
root: .
56+
paths: build
57+
release:
58+
<<: *defaults
59+
steps:
60+
- *fast-checkout
61+
- run: make release
62+
- store_artifacts:
63+
path: build
64+
- persist_to_workspace:
65+
root: .
66+
paths: build
67+
prerelease-upload:
68+
docker:
69+
- image: circleci/python:2.7-jessie
70+
steps:
71+
- *fast-checkout
72+
- run: sudo pip install awscli
73+
- run: make prerelease-upload
74+
workflows:
75+
version: 2
76+
test:
77+
jobs:
78+
- build
79+
- linter:
80+
requires:
81+
- build
82+
- test-golang-1.10:
83+
requires:
84+
- build
85+
- test-golang-1.11-rc:
86+
requires:
87+
- build
88+
- test-golang-1.10-386:
89+
requires:
90+
- build
91+
- prerelease:
92+
requires:
93+
- linter
94+
- test-golang-1.10
95+
- release:
96+
requires:
97+
- linter
98+
- test-golang-1.10
99+
filters:
100+
tags:
101+
only: /^v.*/
102+
branches:
103+
ignore: /.*/
104+
- prerelease-upload:
105+
requires:
106+
- prerelease

Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
CLONE_URL=github.com/pilosa/pilosa
44
VERSION := $(shell git describe --tags 2> /dev/null || echo unknown)
55
VERSION_ID = $(if $(ENTERPRISE_ENABLED),enterprise-)$(VERSION)-$(GOOS)-$(GOARCH)
6-
BRANCH := $(if $(TRAVIS_BRANCH),$(TRAVIS_BRANCH),$(shell git rev-parse --abbrev-ref HEAD))
6+
BRANCH := $(if $(TRAVIS_BRANCH),$(TRAVIS_BRANCH),$(if $(CIRCLE_BRANCH),$(CIRCLE_BRANCH),$(shell git rev-parse --abbrev-ref HEAD)))
77
BRANCH_ID := $(BRANCH)-$(GOOS)-$(GOARCH)
88
BUILD_TIME := $(shell date -u +%FT%T%z)
99
LDFLAGS="-X github.com/pilosa/pilosa.Version=$(VERSION) -X github.com/pilosa/pilosa.BuildTime=$(BUILD_TIME) -X github.com/pilosa/pilosa.Enterprise=$(if $(ENTERPRISE_ENABLED),1)"
@@ -72,7 +72,6 @@ release: check-clean
7272
prerelease: vendor
7373
$(MAKE) release-build GOOS=linux GOARCH=amd64 VERSION_ID=$$\(BRANCH_ID\)
7474
$(if $(shell git describe --tags --exact-match HEAD),$(MAKE) release)
75-
$(MAKE) prerelease-upload
7675

7776
prerelease-upload:
7877
aws s3 sync build/ s3://build.pilosa.com/ --exclude "*" --include "*.tar.gz" --acl public-read

0 commit comments

Comments
 (0)