mirror of
https://github.com/ipfs/kubo.git
synced 2025-05-17 23:16:11 +08:00
Jenkins CI
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
@ -2,6 +2,4 @@
|
|||||||
!.git/HEAD
|
!.git/HEAD
|
||||||
!.git/refs/
|
!.git/refs/
|
||||||
!.git/packed-refs
|
!.git/packed-refs
|
||||||
cmd/ipfs/ipfs
|
test/sharness/lib/sharness/
|
||||||
vendor/gx/
|
|
||||||
test/
|
|
||||||
|
22
Rules.mk
22
Rules.mk
@ -12,6 +12,15 @@ include mk/util.mk
|
|||||||
include mk/golang.mk
|
include mk/golang.mk
|
||||||
include mk/gx.mk
|
include mk/gx.mk
|
||||||
|
|
||||||
|
# -------------------- #
|
||||||
|
# extra properties #
|
||||||
|
# -------------------- #
|
||||||
|
|
||||||
|
ifeq ($(TEST_NO_FUSE),1)
|
||||||
|
GOTAGS += nofuse
|
||||||
|
endif
|
||||||
|
export IPFS_REUSEPORT=false
|
||||||
|
|
||||||
# -------------------- #
|
# -------------------- #
|
||||||
# sub-files #
|
# sub-files #
|
||||||
# -------------------- #
|
# -------------------- #
|
||||||
@ -57,15 +66,6 @@ include $(dir)/Rules.mk
|
|||||||
%.pb.go: %.proto
|
%.pb.go: %.proto
|
||||||
$(PROTOC)
|
$(PROTOC)
|
||||||
|
|
||||||
# -------------------- #
|
|
||||||
# extra properties #
|
|
||||||
# -------------------- #
|
|
||||||
|
|
||||||
ifeq ($(TEST_NO_FUSE),1)
|
|
||||||
GOTAGS += nofuse
|
|
||||||
endif
|
|
||||||
export IPFS_REUSEPORT=false
|
|
||||||
|
|
||||||
# -------------------- #
|
# -------------------- #
|
||||||
# core targets #
|
# core targets #
|
||||||
# -------------------- #
|
# -------------------- #
|
||||||
@ -75,14 +75,14 @@ build: $(TGT_BIN)
|
|||||||
.PHONY: build
|
.PHONY: build
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(CLEAN)
|
rm -rf $(CLEAN)
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
coverage: $(COVERAGE)
|
coverage: $(COVERAGE)
|
||||||
.PHONY: coverage
|
.PHONY: coverage
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
rm -f $(DISTCLEAN)
|
rm -rf $(DISTCLEAN)
|
||||||
.PHONY: distclean
|
.PHONY: distclean
|
||||||
|
|
||||||
test: $(TEST)
|
test: $(TEST)
|
||||||
|
@ -6,7 +6,7 @@ $(d)/gx: $(d)/gx-v0.9.0
|
|||||||
$(d)/gx-go: $(d)/gx-go-v1.3.0
|
$(d)/gx-go: $(d)/gx-go-v1.3.0
|
||||||
|
|
||||||
TGTS_$(d) := $(d)/gx $(d)/gx-go
|
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)
|
PATH := $(realpath $(d)):$(PATH)
|
||||||
|
|
||||||
|
45
ci/Dockerfile.buildenv
Normal file
45
ci/Dockerfile.buildenv
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
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"]
|
1
ci/jenkins
Normal file
1
ci/jenkins
Normal file
@ -0,0 +1 @@
|
|||||||
|
go-ipfs-jenkinsfile
|
@ -3,8 +3,10 @@ include mk/header.mk
|
|||||||
$(d)/coverage_deps:
|
$(d)/coverage_deps:
|
||||||
rm -rf $(@D)/unitcover && mkdir $(@D)/unitcover
|
rm -rf $(@D)/unitcover && mkdir $(@D)/unitcover
|
||||||
rm -rf $(@D)/sharnesscover && mkdir $(@D)/sharnesscover
|
rm -rf $(@D)/sharnesscover && mkdir $(@D)/sharnesscover
|
||||||
|
ifneq ($(IPFS_SKIP_COVER_BINS),1)
|
||||||
go get -u github.com/Kubuxu/gocovmerge
|
go get -u github.com/Kubuxu/gocovmerge
|
||||||
go get -u golang.org/x/tools/cmd/cover
|
go get -u golang.org/x/tools/cmd/cover
|
||||||
|
endif
|
||||||
.PHONY: $(d)/coverage_deps
|
.PHONY: $(d)/coverage_deps
|
||||||
|
|
||||||
# unit tests coverage
|
# unit tests coverage
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
|
# standard NR-make boilerplate, to be included at the end of a file
|
||||||
d := $(dirstack_$(sp))
|
d := $(dirstack_$(sp))
|
||||||
sp := $(basename $(sp))
|
sp := $(basename $(sp))
|
||||||
|
@ -44,7 +44,7 @@ test_go: $(TEST_GO)
|
|||||||
check_go_version:
|
check_go_version:
|
||||||
bin/check_go_version $(GO_MIN_VERSION)
|
bin/check_go_version $(GO_MIN_VERSION)
|
||||||
.PHONY: check_go_version
|
.PHONY: check_go_version
|
||||||
CHECK_GO += check_go_version
|
DEPS_GO += check_go_version
|
||||||
|
|
||||||
TEST += $(TEST_GO)
|
TEST += $(TEST_GO)
|
||||||
TEST_SHORT += test_go_fmt test_go_short
|
TEST_SHORT += test_go_fmt test_go_short
|
||||||
|
9
mk/gx.mk
9
mk/gx.mk
@ -1,6 +1,11 @@
|
|||||||
gx-path = gx/ipfs/$(shell gx deps find $(1))/$(1)
|
gx-path = gx/ipfs/$(shell gx deps find $(1))/$(1)
|
||||||
|
|
||||||
gx-deps: bin/gx bin/gx-go $(CHECK_GO)
|
gx-deps:
|
||||||
gx install --global >/dev/null 2>&1
|
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
|
DEPS_GO += gx-deps
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# keep track of dirs
|
# keep track of dirs
|
||||||
|
# standard NR-make boilerplate, to be included at the beginning of a file
|
||||||
p := $(sp).x
|
p := $(sp).x
|
||||||
dirstack_$(sp) := $(d)
|
dirstack_$(sp) := $(d)
|
||||||
d := $(dir)
|
d := $(dir)
|
||||||
|
Reference in New Issue
Block a user