mirror of
https://github.com/nikdoof/vsphere-influxdb-go.git
synced 2025-12-22 23:19:22 +00:00
add vendoring with go dep
This commit is contained in:
10
vendor/github.com/influxdata/influxdb/releng/raw-binaries/Dockerfile
generated
vendored
Normal file
10
vendor/github.com/influxdata/influxdb/releng/raw-binaries/Dockerfile
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
ARG GO_VERSION
|
||||
FROM golang:${GO_VERSION}
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
jq \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY fs/ /
|
||||
|
||||
ENTRYPOINT ["influxdb_raw_binaries.bash"]
|
||||
58
vendor/github.com/influxdata/influxdb/releng/raw-binaries/build.bash
generated
vendored
Executable file
58
vendor/github.com/influxdata/influxdb/releng/raw-binaries/build.bash
generated
vendored
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
|
||||
function printHelp() {
|
||||
>&2 echo "USAGE: $0 -i PATH_TO_SOURCE_TARBALL -o OUTDIR
|
||||
|
||||
Emits an archive of influxdb binaries based on the current environment's GOOS and GOARCH.
|
||||
|
||||
If the environment variable GO_NEXT is not empty, builds the binaries with the 'next' version of Go.
|
||||
"
|
||||
}
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
printHelp
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$GOOS" ] || [ -z "$GOARCH" ]; then
|
||||
>&2 echo 'The environment variables $GOOS and $GOARCH must both be set.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SRCDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "$SRCDIR/../_go_versions.sh"
|
||||
|
||||
OUTDIR=""
|
||||
TARBALL=""
|
||||
RACE_FLAG=""
|
||||
|
||||
while getopts hi:o:r arg; do
|
||||
case "$arg" in
|
||||
h) printHelp; exit 1;;
|
||||
i) TARBALL="$OPTARG";;
|
||||
o) OUTDIR="$OPTARG";;
|
||||
r) RACE_FLAG="-r";;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "$OUTDIR" ] || [ -z "$TARBALL" ]; 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/raw-binaries:"$DOCKER_TAG" "$SRCDIR"
|
||||
|
||||
mkdir -p "$OUTDIR"
|
||||
|
||||
docker run --rm \
|
||||
--mount type=bind,source="${OUTDIR}",destination=/out \
|
||||
--mount type=bind,source="${TARBALL}",destination=/influxdb-src.tar.gz,ro=1 \
|
||||
-e GOOS -e GOARCH -e CGO_ENABLED \
|
||||
influxdata/influxdb/releng/raw-binaries:"$DOCKER_TAG" $RACE_FLAG
|
||||
80
vendor/github.com/influxdata/influxdb/releng/raw-binaries/fs/usr/local/bin/influxdb_raw_binaries.bash
generated
vendored
Executable file
80
vendor/github.com/influxdata/influxdb/releng/raw-binaries/fs/usr/local/bin/influxdb_raw_binaries.bash
generated
vendored
Executable file
@@ -0,0 +1,80 @@
|
||||
#!/bin/bash
|
||||
|
||||
function printHelp() {
|
||||
>&2 echo "USAGE: $0 [-r]
|
||||
|
||||
Untars the plutonium source tarball mounted at /plutonium-src.tar.gz,
|
||||
then emits a tarball of plutonium binaries to /out,
|
||||
which must be a mounted volume if you want to access the file.
|
||||
|
||||
Relies upon environment variables GOOS and GOARCH to determine what to build.
|
||||
Respects CGO_ENABLED.
|
||||
|
||||
To build with race detection enabled, pass the -r flag.
|
||||
"
|
||||
}
|
||||
|
||||
RACE_FLAG=""
|
||||
|
||||
while getopts hr arg; do
|
||||
case "$arg" in
|
||||
h) printHelp; exit 1;;
|
||||
r) RACE_FLAG="-race";;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
if [ -z "$GOOS" ] || [ -z "$GOARCH" ]; then
|
||||
>&2 echo 'The environment variables $GOOS and $GOARCH must both be set.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Extract tarball into GOPATH.
|
||||
tar xz -C "$GOPATH" -f /influxdb-src.tar.gz
|
||||
|
||||
SHA=$(jq -r .sha < "$GOPATH/src/github.com/influxdata/influxdb/.metadata.json")
|
||||
|
||||
|
||||
SUFFIX=
|
||||
if [ "$CGO_ENABLED" == "0" ]; then
|
||||
# Only add the static suffix to the filename when explicitly requested.
|
||||
SUFFIX=_static
|
||||
elif [ -n "$RACE_FLAG" ]; then
|
||||
# -race depends on cgo, so this option is exclusive from CGO_ENABLED.
|
||||
SUFFIX=_race
|
||||
fi
|
||||
|
||||
TARBALL_NAME="influxdb_bin_${GOOS}_${GOARCH}${SUFFIX}-${SHA}.tar.gz"
|
||||
|
||||
# note: according to https://github.com/golang/go/wiki/GoArm
|
||||
# we want to support armel using GOARM=5
|
||||
# and we want to support armhf using GOARM=6
|
||||
# no GOARM setting is necessary for arm64
|
||||
if [ $GOARCH == "armel" ]; then
|
||||
GOARCH=arm
|
||||
GOARM=5
|
||||
fi
|
||||
|
||||
if [ $GOARCH == "armhf" ]; then
|
||||
GOARCH=arm
|
||||
GOARM=6
|
||||
fi
|
||||
|
||||
|
||||
|
||||
OUTDIR=$(mktemp -d)
|
||||
for cmd in \
|
||||
influxdb/cmd/influxd \
|
||||
influxdb/cmd/influx_stress \
|
||||
influxdb/cmd/influx \
|
||||
influxdb/cmd/influx_inspect \
|
||||
influxdb/cmd/influx_tsm \
|
||||
; do
|
||||
go build $RACE_FLAG -i -o "$OUTDIR/$(basename $cmd)" "github.com/influxdata/$cmd"
|
||||
done
|
||||
|
||||
|
||||
(cd "$OUTDIR" && tar czf "/out/$TARBALL_NAME" ./*)
|
||||
(cd /out && md5sum "$TARBALL_NAME" > "$TARBALL_NAME.md5")
|
||||
(cd /out && sha256sum "$TARBALL_NAME" > "$TARBALL_NAME.sha256")
|
||||
Reference in New Issue
Block a user