mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
Add CircleCI
This commit is contained in:
parent
b7c9726a17
commit
9717dd2d6e
2 changed files with 107 additions and 2 deletions
106
.circleci/config.yml
Normal file
106
.circleci/config.yml
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
version: 2
|
||||
defaults: &defaults
|
||||
working_directory: /go/src/github.com/pilosa/pilosa
|
||||
docker:
|
||||
- image: circleci/golang:1.10
|
||||
fast-checkout: &fast-checkout
|
||||
attach_workspace:
|
||||
at: .
|
||||
jobs:
|
||||
build:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
keys:
|
||||
- vendor-cache-{{ checksum "Gopkg.lock" }}
|
||||
- run: "[ -d vendor ] || make vendor"
|
||||
- save_cache:
|
||||
key: vendor-cache-{{ checksum "Gopkg.lock" }}
|
||||
paths:
|
||||
- vendor
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths: "*"
|
||||
linter:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- *fast-checkout
|
||||
- run: go get -u github.com/alecthomas/gometalinter
|
||||
- run: gometalinter --install
|
||||
- run: go get github.com/remyoudompheng/go-misc/deadcode
|
||||
- run: make gometalinter
|
||||
test-golang-1.10: &base-test
|
||||
<<: *defaults
|
||||
steps:
|
||||
- *fast-checkout
|
||||
- run: sudo apt-get install lsof
|
||||
- run: make test
|
||||
test-golang-1.11-rc:
|
||||
<<: *base-test
|
||||
docker:
|
||||
- image: circleci/golang:1.11-rc
|
||||
test-golang-1.10-386:
|
||||
<<: *base-test
|
||||
environment:
|
||||
GOARCH: 386
|
||||
prerelease:
|
||||
<<: *base-test
|
||||
steps:
|
||||
- *fast-checkout
|
||||
- run: make prerelease
|
||||
- store_artifacts:
|
||||
path: build
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths: build
|
||||
release:
|
||||
<<: *defaults
|
||||
steps:
|
||||
- *fast-checkout
|
||||
- run: make release
|
||||
- store_artifacts:
|
||||
path: build
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths: build
|
||||
prerelease-upload:
|
||||
docker:
|
||||
- image: circleci/python:2.7-jessie
|
||||
steps:
|
||||
- *fast-checkout
|
||||
- run: sudo pip install awscli
|
||||
- run: make prerelease-upload
|
||||
workflows:
|
||||
version: 2
|
||||
test:
|
||||
jobs:
|
||||
- build
|
||||
- linter:
|
||||
requires:
|
||||
- build
|
||||
- test-golang-1.10:
|
||||
requires:
|
||||
- build
|
||||
- test-golang-1.11-rc:
|
||||
requires:
|
||||
- build
|
||||
- test-golang-1.10-386:
|
||||
requires:
|
||||
- build
|
||||
- prerelease:
|
||||
requires:
|
||||
- linter
|
||||
- test-golang-1.10
|
||||
- release:
|
||||
requires:
|
||||
- linter
|
||||
- test-golang-1.10
|
||||
filters:
|
||||
tags:
|
||||
only: /^v.*/
|
||||
branches:
|
||||
ignore: /.*/
|
||||
- prerelease-upload:
|
||||
requires:
|
||||
- prerelease
|
||||
3
Makefile
3
Makefile
|
|
@ -3,7 +3,7 @@
|
|||
CLONE_URL=github.com/pilosa/pilosa
|
||||
VERSION := $(shell git describe --tags 2> /dev/null || echo unknown)
|
||||
VERSION_ID = $(if $(ENTERPRISE_ENABLED),enterprise-)$(VERSION)-$(GOOS)-$(GOARCH)
|
||||
BRANCH := $(if $(TRAVIS_BRANCH),$(TRAVIS_BRANCH),$(shell git rev-parse --abbrev-ref HEAD))
|
||||
BRANCH := $(if $(TRAVIS_BRANCH),$(TRAVIS_BRANCH),$(if $(CIRCLE_BRANCH),$(CIRCLE_BRANCH),$(shell git rev-parse --abbrev-ref HEAD)))
|
||||
BRANCH_ID := $(BRANCH)-$(GOOS)-$(GOARCH)
|
||||
BUILD_TIME := $(shell date -u +%FT%T%z)
|
||||
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
|
|||
prerelease: vendor
|
||||
$(MAKE) release-build GOOS=linux GOARCH=amd64 VERSION_ID=$$\(BRANCH_ID\)
|
||||
$(if $(shell git describe --tags --exact-match HEAD),$(MAKE) release)
|
||||
$(MAKE) prerelease-upload
|
||||
|
||||
prerelease-upload:
|
||||
aws s3 sync build/ s3://build.pilosa.com/ --exclude "*" --include "*.tar.gz" --acl public-read
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue