diff --git a/.circleci/config.yml b/.circleci/config.yml index f2e5f2ea09f62d8e8d0a59eacf8029892cf0f456..5ca3be1ed16c22a5197bde53d458c0fa470aeeb5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,12 +41,12 @@ jobs: at: . - run: make test_integration - test_integration: + ensure_vendor: <<: *defaults steps: - attach_workspace: at: . - - run: make test_integration + - run: make ensure_vendor build_docker: <<: *defaults @@ -114,6 +114,12 @@ workflows: filters: <<: *tags_filters + - ensure_vendor: + requires: + - checkout_code + filters: + <<: *tags_filters + - build_docker: requires: - checkout_code diff --git a/.dockerignore b/.dockerignore index 9a1e1647f0dc47d7ebfe254c583d272b863513af..516f24aca52822661b5f3ea88de9a8c163f11dc6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -11,4 +11,3 @@ CHANGELOG.md README.md .circleci docs -vendor \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7a75ab3232dd7a4660c813e7819db6b1fb9561c7..d50e460097b9dacc3ebfe4e4fcb9f37def82e622 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,12 +3,10 @@ FROM golang:1.9.0-alpine3.6 as builder MAINTAINER Monax <support@monax.io> RUN apk add --no-cache --update git -RUN go get github.com/Masterminds/glide ARG REPO=$GOPATH/src/github.com/hyperledger/burrow COPY . $REPO WORKDIR $REPO -RUN glide install # Build purely static binaries RUN go build --ldflags '-extldflags "-static"' -o bin/burrow ./cmd/burrow diff --git a/Makefile b/Makefile index 945422b72f73427e6fbf7c77203f964f3e441807..82dcd143998dd34dfae412c7470d991b946787b1 100644 --- a/Makefile +++ b/Makefile @@ -77,12 +77,19 @@ erase_vendor: rm -rf ${REPO}/vendor/ # install vendor uses dep to install vendored dependencies -.PHONY: install_vendor -install_vendor: +.PHONY: reinstall_vendor +reinstall_vendor: erase_vendor @go get -u github.com/golang/dep/cmd/dep @dep ensure -v -# Dumps Solidity interface contracts for SNatives +# delete the vendor directy and pull back using dep lock and constraints file +# will exit with an error if the working directory is not clean (any missing files or new +# untracked ones) +.PHONY: ensure_vendor +ensure_vendor: reinstall_vendor + @scripts/is_checkout_dirty.sh + +# dumps Solidity interface contracts for SNatives .PHONY: snatives snatives: @go run ./util/snatives/cmd/main.go diff --git a/scripts/is_checkout_dirty.sh b/scripts/is_checkout_dirty.sh new file mode 100755 index 0000000000000000000000000000000000000000..dc8ce17cd4b764fcb61818c7af627bcf83ac3f64 --- /dev/null +++ b/scripts/is_checkout_dirty.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# Gives us a non-zero exit code if there are tracked or untracked changes in the working +# directory +exit $(git status --porcelain | wc -l)