Jenkins CI

License: MIT
Signed-off-by: default avatarJakub Sztandera <kubuxu@protonmail.ch>
parent dd631878
......@@ -2,6 +2,4 @@
!.git/HEAD
!.git/refs/
!.git/packed-refs
cmd/ipfs/ipfs
vendor/gx/
test/
test/sharness/lib/sharness/
......@@ -12,6 +12,15 @@ include mk/util.mk
include mk/golang.mk
include mk/gx.mk
# -------------------- #
# extra properties #
# -------------------- #
ifeq ($(TEST_NO_FUSE),1)
GOTAGS += nofuse
endif
export IPFS_REUSEPORT=false
# -------------------- #
# sub-files #
# -------------------- #
......@@ -57,15 +66,6 @@ include $(dir)/Rules.mk
%.pb.go: %.proto
$(PROTOC)
# -------------------- #
# extra properties #
# -------------------- #
ifeq ($(TEST_NO_FUSE),1)
GOTAGS += nofuse
endif
export IPFS_REUSEPORT=false
# -------------------- #
# core targets #
# -------------------- #
......@@ -75,14 +75,14 @@ build: $(TGT_BIN)
.PHONY: build
clean:
rm -f $(CLEAN)
rm -rf $(CLEAN)
.PHONY: clean
coverage: $(COVERAGE)
.PHONY: coverage
distclean: clean
rm -f $(DISTCLEAN)
rm -rf $(DISTCLEAN)
.PHONY: distclean
test: $(TEST)
......
......@@ -6,7 +6,7 @@ $(d)/gx: $(d)/gx-v0.9.0
$(d)/gx-go: $(d)/gx-go-v1.3.0
TGTS_$(d) := $(d)/gx $(d)/gx-go
DISTCLEAN += $(wildcard $(d)/gx-v*) $(wildcard $(d)/gx-go-v*)
DISTCLEAN += $(wildcard $(d)/gx-v*) $(wildcard $(d)/gx-go-v*) $(d)/tmp
PATH := $(realpath $(d)):$(PATH)
......
FROM golang:1.7
MAINTAINER Jakub Sztandera <kubuxu@ipfs.io>
RUN apt-get update && apt-get install -y --no-install-recommends \
netcat-openbsd bash curl \
sudo \
&& rm -rf /var/lib/apt/lists/*
ENV GOBIN $GOPATH/bin
ENV SRC_PATH /go/src/github.com/ipfs/go-ipfs
RUN curl -s https://codecov.io/bash > /usr/bin/codecov && chmod +x /usr/bin/codecov \
&& go get -u github.com/Kubuxu/gocovmerge && go get -u golang.org/x/tools/cmd/cover
ENV IPFS_SKIP_COVER_BINS 1
RUN useradd user
RUN chown -R user $GOPATH
WORKDIR $SRC_PATH
COPY ./bin $SRC_PATH/bin/
COPY ./mk $SRC_PATH/mk/
RUN chown -R user $GOPATH
USER user
# install gx and gx-go
RUN make -j 4 -f bin/Rules.mk d=bin bin/gx bin/gx-go && cp bin/gx bin/gx-go $GOBIN
USER root
ENV IPFS_GX_USE_GLOBAL 1
COPY package.json $SRC_PATH/
ENV PATH $SRC_PATH/bin:$PATH
USER user
RUN make -f mk/gx.mk gx-deps
USER root
COPY . $SRC_PATH/
RUN chown -R user $GOPATH
USER user
RUN make cmd/ipfs/ipfs #populate go cache
CMD ["/bin/bash", "-c", "trap : TERM INT; sleep infinity & wait"]
go-ipfs-jenkinsfile
......@@ -3,8 +3,10 @@ include mk/header.mk
$(d)/coverage_deps:
rm -rf $(@D)/unitcover && mkdir $(@D)/unitcover
rm -rf $(@D)/sharnesscover && mkdir $(@D)/sharnesscover
ifneq ($(IPFS_SKIP_COVER_BINS),1)
go get -u github.com/Kubuxu/gocovmerge
go get -u golang.org/x/tools/cmd/cover
endif
.PHONY: $(d)/coverage_deps
# unit tests coverage
......
# standard NR-make boilerplate, to be included at the end of a file
d := $(dirstack_$(sp))
sp := $(basename $(sp))
......@@ -44,7 +44,7 @@ test_go: $(TEST_GO)
check_go_version:
bin/check_go_version $(GO_MIN_VERSION)
.PHONY: check_go_version
CHECK_GO += check_go_version
DEPS_GO += check_go_version
TEST += $(TEST_GO)
TEST_SHORT += test_go_fmt test_go_short
gx-path = gx/ipfs/$(shell gx deps find $(1))/$(1)
gx-deps: bin/gx bin/gx-go $(CHECK_GO)
gx install --global >/dev/null 2>&1
gx-deps:
gx --verbose install --global > /dev/null 2>&1
.PHONY: gx-deps
ifneq ($(IPFS_GX_USE_GLOBAL),1)
gx-deps: bin/gx bin/gx-go
endif
DEPS_GO += gx-deps
# keep track of dirs
# standard NR-make boilerplate, to be included at the beginning of a file
p := $(sp).x
dirstack_$(sp) := $(d)
d := $(dir)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment