Quote all echoings and be consistent about the message prefix
This commit is contained in:
1 parent
0a14eb58b2
commit
8b783af832
1 file changed
+22
-22
+22
-22
@@ -20,10 +20,10 @@ setup() {
|
|||||||
build() {
|
build() {
|
||||||
setup
|
setup
|
||||||
|
|
||||||
echo "Attempting to build distributables for version $VERSION"
|
echo "== Clone repo at $LATEST_TAG for version $VERSION"
|
||||||
if [ -d $RELEASE_DIR ]; then
|
if [ -d $RELEASE_DIR ]; then
|
||||||
echo Release directory $RELEASE_DIR already exists, you may want to >&2
|
echo -e "\u2757 Release directory $RELEASE_DIR already exists, you may want to" >&2
|
||||||
echo rm -rf $RELEASE_DIR >&2
|
echo -e "\trm -rf $RELEASE_DIR" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -35,13 +35,13 @@ build() {
|
|||||||
## Check that the top changelog entry is this version
|
## Check that the top changelog entry is this version
|
||||||
latest_changelog=$(grep -o "Release v.*" -m1 ./CHANGELOG.md)
|
latest_changelog=$(grep -o "Release v.*" -m1 ./CHANGELOG.md)
|
||||||
if ! [ `echo "$latest_changelog" | grep -o 'v[^ ]*'` == $LATEST_TAG ]; then
|
if ! [ `echo "$latest_changelog" | grep -o 'v[^ ]*'` == $LATEST_TAG ]; then
|
||||||
echo Latest changelog entry $latest_changelog does not match >&2
|
echo -e "\u2757 Latest changelog entry $latest_changelog does not match" >&2
|
||||||
echo the latest tag $LATEST_TAG >&2
|
echo "the latest tag $LATEST_TAG" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo == Build and test
|
echo "== Build and test"
|
||||||
|
|
||||||
## Inject the version numbers and build the distributables
|
## Inject the version numbers and build the distributables
|
||||||
## (library versions?)
|
## (library versions?)
|
||||||
@@ -54,20 +54,20 @@ build() {
|
|||||||
WEAVEDNS_IMAGE=$DOCKERHUB_USER/weavedns
|
WEAVEDNS_IMAGE=$DOCKERHUB_USER/weavedns
|
||||||
|
|
||||||
if make tests; then
|
if make tests; then
|
||||||
echo '** Tests pass'
|
echo -e '\u2713 Tests pass'
|
||||||
else
|
else
|
||||||
echo Tests failed, probably best not publish this one >&2
|
echo -e "\u2757 Tests failed, probably best not publish this one" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## Run tests with the distributables, including version check
|
## Run tests with the distributables, including version check
|
||||||
v=$(./weaver/weaver --version)
|
v=$(./weaver/weaver --version)
|
||||||
if ! [ "$v" == "weaver $VERSION" ]; then
|
if ! [ "$v" == "weaver $VERSION" ]; then
|
||||||
echo Version of distributable "$v" does not match tag $LATEST_TAG >&2
|
echo "Version of distributable "$v" does not match tag $LATEST_TAG" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo '** Build OK'
|
echo -e '\u2713 Build OK'
|
||||||
echo '** Release artefacts in' $RELEASE_DIR
|
echo '** Release artefacts in' $RELEASE_DIR
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,12 +75,12 @@ publish() {
|
|||||||
setup
|
setup
|
||||||
cd $PWD/$RELEASE_DIR
|
cd $PWD/$RELEASE_DIR
|
||||||
|
|
||||||
echo == Sanity checks
|
echo "== Sanity checks"
|
||||||
|
|
||||||
if ! which github-release >/dev/null; then
|
if ! which github-release >/dev/null; then
|
||||||
echo Please install git-release: >&2
|
echo "Please install git-release:" >&2
|
||||||
echo -e "\tgo get github.com/aktau/github-release" >&2
|
echo -e "\tgo get github.com/aktau/github-release" >&2
|
||||||
echo and create a git token per https://github.com/aktau/github-release >&2
|
echo "and create a git token per https://github.com/aktau/github-release" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -109,11 +109,11 @@ publish() {
|
|||||||
docker tag $DOCKERHUB_USER/weavedns $DOCKERHUB_USER/weavedns:$VERSION
|
docker tag $DOCKERHUB_USER/weavedns $DOCKERHUB_USER/weavedns:$VERSION
|
||||||
|
|
||||||
docker push $DOCKERHUB_USER/weave:$VERSION
|
docker push $DOCKERHUB_USER/weave:$VERSION
|
||||||
echo == Pushed $DOCKERHUB_USER/weave:$VERSION to docker hub
|
echo "** Pushed $DOCKERHUB_USER/weave:$VERSION to docker hub"
|
||||||
docker push $DOCKERHUB_USER/weavedns:$VERSION
|
docker push $DOCKERHUB_USER/weavedns:$VERSION
|
||||||
echo == Pushed $DOCKERHUB_USER/weavedns:$VERSION to docker hub
|
echo "** Pushed $DOCKERHUB_USER/weavedns:$VERSION to docker hub"
|
||||||
|
|
||||||
echo == Creating GitHub release $RELEASE_NAME $VERSION
|
echo "== Creating GitHub release $RELEASE_NAME $VERSION"
|
||||||
# This cannot be done as a draft because of a bug in
|
# This cannot be done as a draft because of a bug in
|
||||||
# github-release: https://github.com/aktau/github-release/issues/7
|
# github-release: https://github.com/aktau/github-release/issues/7
|
||||||
github-release release \
|
github-release release \
|
||||||
@@ -135,11 +135,11 @@ publish() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo Usage:
|
echo "Usage:"
|
||||||
echo ./bin/release prepare
|
echo -e "\t./bin/release prepare"
|
||||||
echo -- Build artefacts for the latest version tag
|
echo "-- Build artefacts for the latest version tag"
|
||||||
echo ./bin/release publish
|
echo -e "\t./bin/release publish"
|
||||||
echo -- Publish the artefacts for the latest tag to GitHub and DockerHub
|
echo "-- Publish the artefacts for the latest tag to GitHub and DockerHub"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@@ -150,7 +150,7 @@ case "$1" in
|
|||||||
publish
|
publish
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo Unknown command "$1"
|
echo "Unknown command \"$1\""
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
Reference in new issue
Block a user