Merge pull request #56 from dnephin/add-compose-bindata-check

Add CI validation for compose bindata
This commit is contained in:
Daniel Nephin 2017-05-10 15:49:06 -04:00 committed by GitHub
commit bcc46e75ab
6 changed files with 37 additions and 11 deletions

View File

@ -32,8 +32,10 @@ cross: clean
.PHONY: vendor
vendor: vendor.conf
@vndr 2> /dev/null
@if [ "`git status --porcelain -- vendor 2>/dev/null`" ]; then \
echo; echo "vendoring is wrong. These files were changed:"; \
echo; git status --porcelain -- vendor 2>/dev/null; \
echo; exit 1; \
fi;
@script/validate/check-git-diff vendor
cli/compose/schema/bindata.go: cli/compose/schema/data/*.json
go generate github.com/docker/cli/cli/compose/schema
compose-jsonschema: cli/compose/schema/bindata.go
@script/validate/check-git-diff cli/compose/schema/bindata.go

View File

@ -31,11 +31,11 @@ jobs:
docker build -f dockerfiles/Dockerfile.ci --tag cli-builder .
docker run cli-builder make test
- run:
name: "Vendor"
name: "Validate Vendor and Code Generation"
command: |
if [ "$CIRCLE_NODE_INDEX" != "3" ]; then exit; fi
docker build -f dockerfiles/Dockerfile.ci --tag cli-builder .
docker run cli-builder make -B vendor
docker run cli-builder make -B vendor compose-jsonschema
- store_artifacts:
path: /work/build

File diff suppressed because one or more lines are too long

View File

@ -11,6 +11,10 @@ RUN go get github.com/mitchellh/gox && \
cp /go/bin/gox /usr/bin && \
rm -rf /go/src/* /go/pkg/* /go/bin/*
RUN go get github.com/jteeuwen/go-bindata/go-bindata && \
cp /go/bin/go-bindata /usr/bin && \
rm -rf /go/src/* /go/pkg/* /go/bin/*
ENV CGO_ENABLED=0
WORKDIR /go/src/github.com/docker/cli
CMD sh

View File

@ -19,6 +19,10 @@ RUN go get github.com/mitchellh/gox && \
cp /go/bin/gox /usr/bin && \
rm -rf /go/src/* /go/pkg/* /go/bin/*
RUN go get github.com/jteeuwen/go-bindata/go-bindata && \
cp /go/bin/go-bindata /usr/bin && \
rm -rf /go/src/* /go/pkg/* /go/bin/*
COPY . /go/src/github.com/docker/cli
ENV CGO_ENABLED=0

16
script/validate/check-git-diff Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
set -eu
DIFF_PATH=$1
if [ "`git status --porcelain -- $DIFF_PATH 2>/dev/null`" ]; then
echo
echo "These files were changed:"
echo
git status --porcelain -- $DIFF_PATH 2>/dev/null
echo
exit 1
else
echo "$DIFF_PATH is correct"
fi;