Gitlab-CI

pull/76/head
Jakub Matys 2018-10-15 14:58:40 +02:00
parent 71969ebd23
commit 9f425564ed
3 changed files with 31 additions and 9 deletions

21
.gitlab-ci.yml 100644
View File

@ -0,0 +1,21 @@
stages:
- build
- test
build:binary:
stage: build
tags:
- blockbook
script: make build
test:unittest:
stage: test
tags:
- blockbook
script: make test
test:integration:
stage: test
tags:
- blockbook
script: make test-integration ARGS="-run='TestIntegration/(bcash|bgold|bitcoin|dash|dogecoin|litecoin|vertcoin|zcash)/'"

View File

@ -39,17 +39,20 @@ $(addprefix all-, $(TARGETS)): all-%: clean-deb build-images deb-%
all: clean-deb build-images $(addprefix deb-, $(TARGETS))
build-images:
rm -f .bin-image .deb-image
build-images: clean-images
$(MAKE) .bin-image .deb-image
.bin-image:
docker build --no-cache=$(NO_CACHE) -t $(BIN_IMAGE) build/docker/bin
@ docker images -q $(BIN_IMAGE) > $@
@if [ -z "$(shell docker images --quiet --filter=reference=$(BIN_IMAGE):latest)" ]; then \
echo "Building image $(BIN_IMAGE)..."; \
docker build --no-cache=$(NO_CACHE) -t $(BIN_IMAGE) build/docker/bin; \
fi
.deb-image: .bin-image
docker build --no-cache=$(NO_CACHE) -t $(DEB_IMAGE) build/docker/deb
@ docker images -q $(DEB_IMAGE) > $@
@if [ -z "$(shell docker images --quiet --filter=reference=$(DEB_IMAGE):latest)" ]; then \
echo "Building image $(DEB_IMAGE)..."; \
docker build --no-cache=$(NO_CACHE) -t $(DEB_IMAGE) build/docker/deb; \
fi
clean: clean-bin clean-deb
@ -66,8 +69,6 @@ clean-images: clean-bin-image clean-deb-image
clean-bin-image:
- docker rmi $(BIN_IMAGE)
@ rm -f .bin-image
clean-deb-image:
- docker rmi $(DEB_IMAGE)
@ rm -f .deb-image

View File

@ -34,7 +34,7 @@ test-all: prepare-sources generate-data
prepare-sources:
@ [ -n "`ls /src 2> /dev/null`" ] || (echo "/src doesn't exist or is empty" 1>&2 && exit 1)
[ -d $(BLOCKBOOK_SRC) ] && rm -rf $(BLOCKBOOK_SRC)
rm -rf $(BLOCKBOOK_SRC)
cp -r /src $(BLOCKBOOK_SRC)
$(MAKE) prepare-vendor