1
0
mirror of https://github.com/Oxalide/vsphere-influxdb-go.git synced 2023-10-10 11:36:51 +00:00

add vendoring with go dep

This commit is contained in:
Adrian Todorov
2017-10-25 20:52:40 +00:00
parent 704f4d20d1
commit a59409f16b
1627 changed files with 489673 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
ARG GO_VERSION
FROM golang:${GO_VERSION}-alpine
RUN apk add --no-cache \
bash \
jq \
git
RUN go get -u github.com/jstemmer/go-junit-report && \
mv /go/bin/go-junit-report /usr/bin/go-junit-report && \
rm -rf /go/*
COPY fs/ /
ENTRYPOINT ["influxdb_prebuild_tests.bash"]

View File

@@ -0,0 +1,7 @@
#!/bin/bash
# Extract tarball into GOPATH.
tar xz -C "$GOPATH" -f /influxdb-src.tar.gz
cd "$GOPATH/src/github.com/influxdata/influxdb"
go test -v ./... 2>&1 | tee /out/tests.log | go-junit-report > /out/influxdb.junit.xml

View File

@@ -0,0 +1,48 @@
#!/bin/bash
function printHelp() {
>&2 echo "USAGE: $0 -i PATH_TO_SOURCE_TARBALL -o OUTDIR
Runs unit tests for influxdb.
If the environment variable GO_NEXT is not empty, tests run with the 'next' version of Go.
"
}
if [ $# -eq 0 ]; then
printHelp
exit 1
fi
SRCDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SRCDIR/../_go_versions.sh"
OUTDIR=""
TARBALL=""
while getopts hi:o: arg; do
case "$arg" in
h) printHelp; exit 1;;
i) TARBALL="$OPTARG";;
o) OUTDIR="$OPTARG";;
esac
done
if [ -z "$TARBALL" ] || [ -z "$OUTDIR" ]; then
printHelp
exit 1
fi
if [ -z "$GO_NEXT" ]; then
DOCKER_TAG=latest
GO_VERSION="$GO_CURRENT_VERSION"
else
DOCKER_TAG=next
GO_VERSION="$GO_NEXT_VERSION"
fi
docker build --build-arg "GO_VERSION=$GO_VERSION" -t influxdata/influxdb/releng/unit-tests:"$DOCKER_TAG" "$SRCDIR"
docker run --rm \
--mount type=bind,source="$OUTDIR",destination=/out \
--mount type=bind,source="$TARBALL",destination=/influxdb-src.tar.gz,ro=1 \
influxdata/influxdb/releng/unit-tests:"$DOCKER_TAG"