Add vendor folder to git

This commit is contained in:
Lucas Käldström 2017-06-26 19:23:05 +03:00
parent 66cf5eaafb
commit 183585f56f
No known key found for this signature in database
GPG key ID: 600FEFBBD0D40D21
6916 changed files with 2629581 additions and 1 deletions

73
vendor/github.com/coreos/etcd/scripts/build-aci generated vendored Normal file
View file

@ -0,0 +1,73 @@
#!/usr/bin/env bash
set -e
BINARYDIR=${BINARYDIR:-bin}
BUILDDIR=${BUILDDIR:-bin}
# A non-installed acbuild can be used, for example:
# ACBUILD=../../appc/acbuild/bin/acbuild
ACBUILD=${ACBUILD:-acbuild}
VERSION=$1
if ! command -v $ACBUILD >/dev/null; then
echo "acbuild ($ACBUILD) is not executable"
exit 1
fi
if [ ! -x $BINARYDIR/etcd ] ; then
echo "$BINARYDIR/etcd not found. Is it compiled?"
exit 1
fi
if [ -z "$VERSION" ] ; then
echo "Usage: scripts/build-aci VERSION"
exit 1
fi
acbuild --debug begin
TMPHOSTS="$(mktemp)"
acbuildEnd() {
rm "$TMPHOSTS"
export EXIT=$?
acbuild --debug end && exit $EXIT
}
trap acbuildEnd EXIT
cat <<DF > $TMPHOSTS
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
DF
acbuild --debug set-name coreos.com/etcd
acbuild --debug copy $BINARYDIR/etcd /usr/local/bin/etcd
acbuild --debug copy $BINARYDIR/etcdctl /usr/local/bin/etcdctl
acbuild --debug copy README.md README.md
acbuild --debug copy etcdctl/README.md README-etcdctl.md
acbuild --debug copy etcdctl/READMEv2.md READMEv2-etcdctl.md
acbuild --debug copy-to-dir Documentation .
acbuild --debug environment add ETCD_DATA_DIR /var/lib/etcd
acbuild --debug mount add data-dir /var/lib/etcd
acbuild --debug label add version "$VERSION"
acbuild --debug set-exec -- /usr/local/bin/etcd
acbuild --debug port add client tcp 2379
acbuild --debug port add peer tcp 2380
acbuild --debug copy "$TMPHOSTS" /etc/hosts
# mkdir default data-dir
mkdir -p .acbuild/currentaci/rootfs/var/lib/etcd
# symlinks for backward-compatibility
ln -s ./usr/local/bin/etcd .acbuild/currentaci/rootfs/etcd
ln -s ./usr/local/bin/etcdctl .acbuild/currentaci/rootfs/etcdctl
acbuild --debug write --overwrite $BUILDDIR/etcd-${1}-linux-amd64.aci

82
vendor/github.com/coreos/etcd/scripts/build-binary generated vendored Normal file
View file

@ -0,0 +1,82 @@
#!/usr/bin/env bash
set -e
VER=$1
PROJ="etcd"
if [ -z "$1" ]; then
echo "Usage: ${0} VERSION" >> /dev/stderr
exit 255
fi
set -u
function setup_env {
local proj=${1}
local ver=${2}
if [ ! -d ${proj} ]; then
git clone https://github.com/coreos/${proj}
fi
pushd ${proj} >/dev/null
git checkout master
git fetch --all
git reset --hard origin/master
git checkout $ver
popd >/dev/null
}
function package {
local target=${1}
local srcdir="${2}/bin"
local ccdir="${srcdir}/${GOOS}_${GOARCH}"
if [ -d ${ccdir} ]; then
srcdir=${ccdir}
fi
local ext=""
if [ ${GOOS} == "windows" ]; then
ext=".exe"
fi
for bin in etcd etcdctl; do
cp ${srcdir}/${bin} ${target}/${bin}${ext}
done
cp etcd/README.md ${target}/README.md
cp etcd/etcdctl/README.md ${target}/README-etcdctl.md
cp etcd/etcdctl/READMEv2.md ${target}/READMEv2-etcdctl.md
cp -R etcd/Documentation ${target}/Documentation
}
function main {
mkdir release
cd release
setup_env ${PROJ} ${VER}
for os in darwin windows linux; do
export GOOS=${os}
export GOARCH="amd64"
pushd etcd >/dev/null
GO_LDFLAGS="-s" ./build
popd >/dev/null
TARGET="etcd-${VER}-${GOOS}-${GOARCH}"
mkdir ${TARGET}
package ${TARGET} ${PROJ}
if [ ${GOOS} == "linux" ]; then
tar cfz ${TARGET}.tar.gz ${TARGET}
echo "Wrote release/${TARGET}.tar.gz"
else
zip -qr ${TARGET}.zip ${TARGET}
echo "Wrote release/${TARGET}.zip"
fi
done
}
main

13
vendor/github.com/coreos/etcd/scripts/build-docker generated vendored Normal file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env bash
BINARYDIR=${BINARYDIR:-.}
BUILDDIR=${BUILDDIR:-.}
IMAGEDIR=${BUILDDIR}/image-docker
mkdir -p ${IMAGEDIR}
cp ${BINARYDIR}/etcd ${BINARYDIR}/etcdctl ${IMAGEDIR}
cat ./Dockerfile-release > ${IMAGEDIR}/Dockerfile
docker build -t quay.io/coreos/etcd:${1} ${IMAGEDIR}

112
vendor/github.com/coreos/etcd/scripts/genproto.sh generated vendored Normal file
View file

@ -0,0 +1,112 @@
#!/usr/bin/env bash
#
# Generate all etcd protobuf bindings.
# Run from repository root.
#
set -e
if ! [[ "$0" =~ "scripts/genproto.sh" ]]; then
echo "must be run from repository root"
exit 255
fi
# for now, be conservative about what version of protoc we expect
if ! [[ $(protoc --version) =~ "3.1.0" ]]; then
echo "could not find protoc 3.1.0, is it installed + in PATH?"
exit 255
fi
# directories containing protos to be built
DIRS="./wal/walpb ./etcdserver/etcdserverpb ./snap/snappb ./raft/raftpb ./mvcc/mvccpb ./lease/leasepb ./auth/authpb"
# exact version of protoc-gen-gogo to build
GOGO_PROTO_SHA="8d70fb3182befc465c4a1eac8ad4d38ff49778e2"
GRPC_GATEWAY_SHA="84398b94e188ee336f307779b57b3aa91af7063c"
# set up self-contained GOPATH for building
export GOPATH=${PWD}/gopath.proto
export GOBIN=${PWD}/bin
export PATH="${GOBIN}:${PATH}"
COREOS_ROOT="${GOPATH}/src/github.com/coreos"
ETCD_ROOT="${COREOS_ROOT}/etcd"
GOGOPROTO_ROOT="${GOPATH}/src/github.com/gogo/protobuf"
GOGOPROTO_PATH="${GOGOPROTO_ROOT}:${GOGOPROTO_ROOT}/protobuf"
GRPC_GATEWAY_ROOT="${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway"
rm -f "${ETCD_ROOT}"
mkdir -p "${COREOS_ROOT}"
ln -s "${PWD}" "${ETCD_ROOT}"
# Ensure we have the right version of protoc-gen-gogo by building it every time.
# TODO(jonboulle): vendor this instead of `go get`ting it.
go get -u github.com/gogo/protobuf/{proto,protoc-gen-gogo,gogoproto}
go get -u golang.org/x/tools/cmd/goimports
pushd "${GOGOPROTO_ROOT}"
git reset --hard "${GOGO_PROTO_SHA}"
make install
popd
# generate gateway code
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
pushd "${GRPC_GATEWAY_ROOT}"
git reset --hard "${GRPC_GATEWAY_SHA}"
go install ./protoc-gen-grpc-gateway
popd
for dir in ${DIRS}; do
pushd ${dir}
protoc --gofast_out=plugins=grpc,import_prefix=github.com/coreos/:. -I=.:"${GOGOPROTO_PATH}":"${COREOS_ROOT}":"${GRPC_GATEWAY_ROOT}/third_party/googleapis" *.proto
sed -i.bak -E "s/github\.com\/coreos\/(gogoproto|github\.com|golang\.org|google\.golang\.org)/\1/g" *.pb.go
sed -i.bak -E 's/github\.com\/coreos\/(errors|fmt|io)/\1/g' *.pb.go
sed -i.bak -E 's/import _ \"gogoproto\"//g' *.pb.go
sed -i.bak -E 's/import fmt \"fmt\"//g' *.pb.go
sed -i.bak -E 's/import _ \"github\.com\/coreos\/google\/api\"//g' *.pb.go
rm -f *.bak
goimports -w *.pb.go
popd
done
protoc -I. \
-I${GRPC_GATEWAY_ROOT}/third_party/googleapis \
-I${GOGOPROTO_PATH} \
-I${COREOS_ROOT} \
--grpc-gateway_out=logtostderr=true:. \
--swagger_out=logtostderr=true:./Documentation/dev-guide/apispec/swagger/. \
./etcdserver/etcdserverpb/rpc.proto
# TODO: change this whenever we add more swagger API
mv \
Documentation/dev-guide/apispec/swagger/etcdserver/etcdserverpb/rpc.swagger.json \
Documentation/dev-guide/apispec/swagger/rpc.swagger.json
rm -rf Documentation/dev-guide/apispec/swagger/etcdserver/etcdserverpb
# install protodoc
# go get -v -u github.com/coreos/protodoc
#
# by default, do not run this option.
# only run when './scripts/genproto.sh -g'
#
if [ "$1" = "-g" ]; then
echo "protodoc is auto-generating grpc API reference documentation..."
go get -v -u github.com/coreos/protodoc
SHA_PROTODOC="f4164b1cce80b5eba4c835d08483f552dc568b7c"
PROTODOC_PATH="${GOPATH}/src/github.com/coreos/protodoc"
pushd "${PROTODOC_PATH}"
git reset --hard "${SHA_PROTODOC}"
go install
echo "protodoc is updated"
popd
protodoc --directories="etcdserver/etcdserverpb=service_message,mvcc/mvccpb=service_message,lease/leasepb=service_message,auth/authpb=service_message" \
--title="etcd API Reference" \
--output="Documentation/dev-guide/api_reference_v3.md" \
--message-only-from-this-file="etcdserver/etcdserverpb/rpc.proto" \
--disclaimer="This is a generated documentation. Please read the proto files for more."
echo "protodoc is finished..."
else
echo "skipping grpc API reference document auto-generation..."
fi

33
vendor/github.com/coreos/etcd/scripts/release.sh generated vendored Normal file
View file

@ -0,0 +1,33 @@
#!/usr/bin/env bash
#
# Build all release binaries and images to directory ./release.
# Run from repository root.
#
set -e
VERSION=$1
if [ -z "${VERSION}" ]; then
echo "Usage: ${0} VERSION" >> /dev/stderr
exit 255
fi
if ! command -v acbuild >/dev/null; then
echo "cannot find acbuild"
exit 1
fi
if ! command -v docker >/dev/null; then
echo "cannot find docker"
exit 1
fi
ETCD_ROOT=$(dirname "${BASH_SOURCE}")/..
pushd ${ETCD_ROOT} >/dev/null
echo Building etcd binary...
./scripts/build-binary ${VERSION}
echo Building aci image...
BINARYDIR=release/etcd-${VERSION}-linux-amd64 BUILDDIR=release ./scripts/build-aci ${VERSION}
echo Building docker image...
BINARYDIR=release/etcd-${VERSION}-linux-amd64 BUILDDIR=release ./scripts/build-docker ${VERSION}
popd >/dev/null

78
vendor/github.com/coreos/etcd/scripts/updatedep.sh generated vendored Normal file
View file

@ -0,0 +1,78 @@
#!/usr/bin/env bash
# A script for updating godep dependencies for the vendored directory /cmd/
# without pulling in etcd itself as a dependency.
#
# update depedency
# 1. edit glide.yaml with version, git SHA
# 2. run ./scripts/updatedep.sh
# 3. it automatically detects new git SHA, and vendors updates to cmd/vendor directory
#
# add depedency
# 1. run ./scripts/updatedep.sh github.com/USER/PROJECT#^1.0.0
# OR
# ./scripts/updatedep.sh github.com/USER/PROJECT#9b772b54b3bf0be1eec083c9669766a56332559a
# 2. make sure glide.yaml and glide.lock are updated
if ! [[ "$0" =~ "scripts/updatedep.sh" ]]; then
echo "must be run from repository root"
exit 255
fi
rm -rf vendor
mv cmd/vendor vendor
# TODO: glide doesn't play well with symlink
echo "manually deleting etcd-repo symlink in vendor"
rm -f vendor/github.com/coreos/etcd
GLIDE_ROOT="$GOPATH/src/github.com/Masterminds/glide"
GLIDE_SHA=21ff6d397ccca910873d8eaabab6a941c364cc70
go get -d -u github.com/Masterminds/glide
pushd "${GLIDE_ROOT}"
git reset --hard ${GLIDE_SHA}
go install
popd
GLIDE_VC_ROOT="$GOPATH/src/github.com/sgotti/glide-vc"
GLIDE_VC_SHA=d96375d23c85287e80296cdf48f9d21c227fa40a
go get -d -u github.com/sgotti/glide-vc
pushd "${GLIDE_VC_ROOT}"
git reset --hard ${GLIDE_VC_SHA}
go install
popd
if [ -n "$1" ]; then
echo "glide get on $(echo $1)"
matches=`grep "name: $1" glide.lock`
if [ ! -z "$matches" ]; then
echo "glide update on $1"
glide update --strip-vendor $1
else
echo "glide get on $1"
glide get --strip-vendor $1
fi
else
echo "glide update on *"
glide update --strip-vendor
fi;
# TODO: workaround to keep 'github.com/stretchr/testify/assert' in v2 tests
# TODO: remove this after dropping v2
echo "copying github.com/stretchr/testify/assert"
cp -rf vendor/github.com/stretchr/testify/assert ./temp-assert
echo "removing test files"
glide vc --only-code --no-tests
# TODO: remove this after dropping v2
mkdir -p vendor/github.com/stretchr/testify
mv ./temp-assert vendor/github.com/stretchr/testify/assert
mv vendor cmd/
echo "recreating symlink to etcd"
ln -s ../../../../ cmd/vendor/github.com/coreos/etcd
echo "done"