6 # Get the version from the environment, or try to figure it out.
7 if [ -z $VERSION ]; then
8 VERSION=$(awk -F\" '/Version =/ { print $2; exit }' < version/version.go)
10 if [ -z "$VERSION" ]; then
11 echo "Please specify a version."
14 echo "==> Building version $VERSION..."
16 # Get the parent directory of where this script is.
17 SOURCE="${BASH_SOURCE[0]}"
18 while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
19 DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
21 # Change into that dir because we expect that.
25 echo "==> Removing old directory..."
30 # Do a hermetic build inside a Docker container.
31 docker build -t tendermint/${REPO_NAME}-builder scripts/${REPO_NAME}-builder/
32 docker run --rm -e "BUILD_TAGS=$BUILD_TAGS" -v "$(pwd)":/go/src/github.com/tendermint/${REPO_NAME} tendermint/${REPO_NAME}-builder ./scripts/dist_build.sh
34 # Add $REPO_NAME and $VERSION prefix to package name.
37 for FILENAME in $(find ./build/pkg -mindepth 1 -maxdepth 1 -type f); do
38 FILENAME=$(basename "$FILENAME")
39 cp "./build/pkg/${FILENAME}" "./build/dist/${REPO_NAME}_${VERSION}_${FILENAME}"
44 shasum -a256 ./* > "./${REPO_NAME}_${VERSION}_SHA256SUMS"