Jenkins CI
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
Feb 1, 2017 at 13:17 UTC
545f03e9c357f72a5ace50ca4df80bd4510f77a7
10 files changed
+71
-18
.dockerignore
+1
-3
@@ -2,6 +2,4 @@
2
!.git/HEAD
3
!.git/refs/
4
!.git/packed-refs
5
-cmd/ipfs/ipfs
6
-vendor/gx/
7
-test/
5
+test/sharness/lib/sharness/
Rules.mk
+11
-11
@@ -12,6 +12,15 @@ include mk/util.mk
12
include mk/golang.mk
13
include mk/gx.mk
14
15
+# -------------------- #
16
+# extra properties #
17
+# -------------------- #
18
+
19
+ifeq ($(TEST_NO_FUSE),1)
20
+ GOTAGS += nofuse
21
+endif
22
+export IPFS_REUSEPORT=false
23
+
24
# -------------------- #
25
# sub-files #
26
# -------------------- #
@@ -57,15 +66,6 @@ include $(dir)/Rules.mk
66
%.pb.go: %.proto
67
$(PROTOC)
68
60
-# -------------------- #
61
-# extra properties #
62
-# -------------------- #
63
-
64
-ifeq ($(TEST_NO_FUSE),1)
65
- GOTAGS += nofuse
66
-endif
67
-export IPFS_REUSEPORT=false
68
-
69
# -------------------- #
70
# core targets #
71
# -------------------- #
@@ -75,14 +75,14 @@ build: $(TGT_BIN)
75
.PHONY: build
76
77
clean:
78
- rm -f $(CLEAN)
78
+ rm -rf $(CLEAN)
79
.PHONY: clean
80
81
coverage: $(COVERAGE)
82
.PHONY: coverage
83
84
distclean: clean
85
- rm -f $(DISTCLEAN)
85
+ rm -rf $(DISTCLEAN)
86
.PHONY: distclean
87
88
test: $(TEST)
bin/Rules.mk
+1
-1
@@ -6,7 +6,7 @@ $(d)/gx: $(d)/gx-v0.9.0
6
$(d)/gx-go: $(d)/gx-go-v1.3.0
7
8
TGTS_$(d) := $(d)/gx $(d)/gx-go
9
-DISTCLEAN += $(wildcard $(d)/gx-v*) $(wildcard $(d)/gx-go-v*)
9
+DISTCLEAN += $(wildcard $(d)/gx-v*) $(wildcard $(d)/gx-go-v*) $(d)/tmp
10
11
PATH := $(realpath $(d)):$(PATH)
12
ci/Dockerfile.buildenv
new
+45
@@ -0,0 +1,45 @@
1
+FROM golang:1.7
2
+MAINTAINER Jakub Sztandera <kubuxu@ipfs.io>
3
+
4
+
5
+RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ netcat-openbsd bash curl \
7
+ sudo \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ENV GOBIN $GOPATH/bin
11
+ENV SRC_PATH /go/src/github.com/ipfs/go-ipfs
12
+
13
+RUN curl -s https://codecov.io/bash > /usr/bin/codecov && chmod +x /usr/bin/codecov \
14
+ && go get -u github.com/Kubuxu/gocovmerge && go get -u golang.org/x/tools/cmd/cover
15
+ENV IPFS_SKIP_COVER_BINS 1
16
+
17
+
18
+RUN useradd user
19
+RUN chown -R user $GOPATH
20
+
21
+WORKDIR $SRC_PATH
22
+
23
+COPY ./bin $SRC_PATH/bin/
24
+COPY ./mk $SRC_PATH/mk/
25
+RUN chown -R user $GOPATH
26
+
27
+USER user
28
+# install gx and gx-go
29
+RUN make -j 4 -f bin/Rules.mk d=bin bin/gx bin/gx-go && cp bin/gx bin/gx-go $GOBIN
30
+USER root
31
+ENV IPFS_GX_USE_GLOBAL 1
32
+
33
+COPY package.json $SRC_PATH/
34
+ENV PATH $SRC_PATH/bin:$PATH
35
+
36
+USER user
37
+RUN make -f mk/gx.mk gx-deps
38
+USER root
39
+
40
+COPY . $SRC_PATH/
41
+RUN chown -R user $GOPATH
42
+USER user
43
+RUN make cmd/ipfs/ipfs #populate go cache
44
+
45
+CMD ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
ci/jenkins
new
+1
@@ -0,0 +1 @@
1
+go-ipfs-jenkinsfile
coverage/Rules.mk
+2
@@ -3,8 +3,10 @@ include mk/header.mk
3
$(d)/coverage_deps:
4
rm -rf $(@D)/unitcover && mkdir $(@D)/unitcover
5
rm -rf $(@D)/sharnesscover && mkdir $(@D)/sharnesscover
6
+ifneq ($(IPFS_SKIP_COVER_BINS),1)
7
go get -u github.com/Kubuxu/gocovmerge
8
go get -u golang.org/x/tools/cmd/cover
9
+endif
10
.PHONY: $(d)/coverage_deps
11
12
# unit tests coverage
mk/footer.mk
+1
@@ -1,2 +1,3 @@
1
+# standard NR-make boilerplate, to be included at the end of a file
2
d := $(dirstack_$(sp))
3
sp := $(basename $(sp))
mk/golang.mk
+1
-1
@@ -44,7 +44,7 @@ test_go: $(TEST_GO)
44
check_go_version:
45
bin/check_go_version $(GO_MIN_VERSION)
46
.PHONY: check_go_version
47
-CHECK_GO += check_go_version
47
+DEPS_GO += check_go_version
48
49
TEST += $(TEST_GO)
50
TEST_SHORT += test_go_fmt test_go_short
mk/gx.mk
+7
-2
@@ -1,6 +1,11 @@
1
gx-path = gx/ipfs/$(shell gx deps find $(1))/$(1)
2
3
-gx-deps: bin/gx bin/gx-go $(CHECK_GO)
4
- gx install --global >/dev/null 2>&1
3
+gx-deps:
4
+ gx --verbose install --global > /dev/null 2>&1
5
+.PHONY: gx-deps
6
+
7
+ifneq ($(IPFS_GX_USE_GLOBAL),1)
8
+gx-deps: bin/gx bin/gx-go
9
+endif
10
11
DEPS_GO += gx-deps
mk/header.mk
+1
@@ -1,4 +1,5 @@
1
# keep track of dirs
2
+# standard NR-make boilerplate, to be included at the beginning of a file
3
p := $(sp).x
4
dirstack_$(sp) := $(d)
5
d := $(dir)