File tree 4 files changed +75
-15
lines changed
4 files changed +75
-15
lines changed Original file line number Diff line number Diff line change 1
1
# NOTE: Current plan gives 1500 build minutes per month.
2
2
version : 2
3
3
jobs :
4
- build :
4
+ test :
5
5
docker :
6
6
# Available from https://hub.docker.com/r/circleci/golang/
7
7
- image : circleci/golang:1.10
@@ -32,15 +32,53 @@ jobs:
32
32
echo "Skipping AWS tests."
33
33
34
34
make test
35
+
36
+ build :
37
+ machine : true
38
+ working_directory : /home/circleci/.go_workspace/src/github.com/improbable-eng/thanos
39
+ steps :
40
+ - checkout
41
+ - run : make promu
42
+ - run : make crossbuild
43
+ - persist_to_workspace :
44
+ root : .
45
+ paths :
46
+ - .build
47
+
48
+ publish_master :
49
+ docker :
50
+ # Available from https://hub.docker.com/r/circleci/golang/
51
+ - image : circleci/golang:1.10
52
+ working_directory : /go/src/github.com/improbable-eng/thanos
53
+ steps :
54
+ - checkout
55
+ - setup_remote_docker :
56
+ version : 17.07.0-ce
57
+ - attach_workspace :
58
+ at : .
59
+ - run : ln -s .build/linux-amd64/thanos thanos
35
60
- run : make docker
36
- - run :
37
- name : Run tests on generated Docker image
38
- command : |
39
- docker run thanos --help
40
- - deploy :
41
- name : Push Docker image
42
- command : |
43
- if [ "${CIRCLE_BRANCH}" == "master" ]; then
44
- docker login -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}"
45
- make docker-push
46
- fi
61
+ - run : docker run thanos --help
62
+ - run : docker login -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}"
63
+ - run : make docker-push
64
+
65
+
66
+ workflows :
67
+ version : 2
68
+ thanos :
69
+ jobs :
70
+ - test :
71
+ filters :
72
+ tags :
73
+ only : /.*/
74
+ - build :
75
+ filters :
76
+ tags :
77
+ only : /.*/
78
+ - publish_master :
79
+ requires :
80
+ - test
81
+ - build
82
+ filters :
83
+ branches :
84
+ only : master
Original file line number Diff line number Diff line change @@ -8,3 +8,8 @@ kube/.minikube
8
8
9
9
# Ignore e2e working dirs.
10
10
data /
11
+
12
+ # Ignore promu artifacts.
13
+ /.build
14
+ /.release
15
+ /.tarballs
Original file line number Diff line number Diff line change 11
11
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Branch={{.Branch}}
12
12
-X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildUser={{user}}@{{host}}
13
13
-X {{repoPath}}/vendor/github.com/prometheus/common/version.BuildDate={{date "20060102-15:04:05"}}
14
+ crossbuild :
15
+ platforms :
16
+ - linux/amd64
17
+ - darwin/amd64
18
+ - linux/arm64
19
+ - windows/amd64
Original file line number Diff line number Diff line change @@ -36,17 +36,28 @@ errcheck:
36
36
@echo " >> errchecking the code"
37
37
@errcheck -verbose -exclude .errcheck_excludes.txt ./...
38
38
39
- build : deps $( PROMU )
39
+ build : deps promu
40
40
@echo " >> building binaries"
41
41
@$(PROMU ) build --prefix $(PREFIX )
42
42
43
+ .PHONY : crossbuild
44
+ crossbuild : deps promu
45
+ @echo " >> crossbuilding all binaries"
46
+ $(PROMU ) crossbuild -v
47
+
48
+ .PHONY : tarball
49
+ tarball : promu
50
+ @echo " >> building release tarball"
51
+ $(PROMU ) tarball --prefix $(PREFIX ) $(BIN_DIR )
52
+
43
53
$(GOIMPORTS ) :
44
54
@echo " >> fetching goimports"
45
55
@go get -u golang.org/x/tools/cmd/goimports
46
56
47
- $(PROMU ) :
57
+ .PHONY : promu
58
+ promu :
48
59
@echo " >> fetching promu"
49
- @ go get -u github.com/prometheus/promu
60
+ GOOS= GOARCH= go get -u github.com/prometheus/promu
50
61
51
62
$(DEP ) :
52
63
@echo " >> fetching dep"
You can’t perform that action at this time.
0 commit comments