release.sh 919 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env bash
  2. #
  3. # Build all release binaries and images to directory ./release.
  4. # Run from repository root.
  5. #
  6. set -e
  7. VERSION=$1
  8. if [ -z "${VERSION}" ]; then
  9. echo "Usage: ${0} VERSION" >> /dev/stderr
  10. exit 255
  11. fi
  12. # A non-installed actool can be used, for example:
  13. # ACTOOL=../../appc/spec/bin/actool
  14. ACTOOL=${ACTOOL:-actool}
  15. if ! command -v $ACTOOL >/dev/null; then
  16. echo "cannot find actool ($ACTOOL)"
  17. exit 1
  18. fi
  19. if ! command -v docker >/dev/null; then
  20. echo "cannot find docker"
  21. exit 1
  22. fi
  23. ETCD_ROOT=$(dirname "${BASH_SOURCE}")/..
  24. pushd ${ETCD_ROOT} >/dev/null
  25. echo Building etcd binary...
  26. ./scripts/build-binary ${VERSION}
  27. echo Building aci image...
  28. BINARYDIR=release/etcd-${VERSION}-linux-amd64 BUILDDIR=release ./scripts/build-aci ${VERSION}
  29. echo Building docker image...
  30. BINARYDIR=release/etcd-${VERSION}-linux-amd64 BUILDDIR=release ./scripts/build-docker ${VERSION}
  31. popd >/dev/null