From d18b1f4f2d19a15657dcc9c75e0d481abdfc0b83 Mon Sep 17 00:00:00 2001 From: davidnewhall2 Date: Sun, 29 Dec 2019 18:36:32 -0800 Subject: [PATCH] fix prerelease build --- init/docker/hooks/push | 11 ++++++++++- scripts/formula-deploy.sh | 17 ----------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/init/docker/hooks/push b/init/docker/hooks/push index b4c52546..d3f8e184 100755 --- a/init/docker/hooks/push +++ b/init/docker/hooks/push @@ -25,7 +25,16 @@ done echo "Annotating Images: ${IMAGES}" # Build all the Docker tags if the source branch is a release and not a branch. -[ "v$VERSION" != "$SOURCE_BRANCH" ] || TAGS="latest $VERSION $SHORTVER stable" +if [ "v$VERSION" == "$SOURCE_BRANCH" ]; then + TAGS="$VERSION $(echo $VERSION | cut -d. -f1,2)" + + echo $SOURCE_BRANCH | grep -q -- - + if [ "$?" == "1" ]; then + # tag does not contain a dash, so assume it's a prod tag. + TAGS="$TAGS latest stable" + fi +fi + echo "Version: $VERSION, Source: $SOURCE_BRANCH, Building tags: ${TAGS}" # Create multi-architecture manifests for each tag with all the built images. diff --git a/scripts/formula-deploy.sh b/scripts/formula-deploy.sh index 843c5139..b93d92e5 100755 --- a/scripts/formula-deploy.sh +++ b/scripts/formula-deploy.sh @@ -16,23 +16,6 @@ git config --global user.name "${BINARY}-auto-releaser" rm -rf homebrew_release_repo git clone git@github.com:${HBREPO}.git homebrew_release_repo -# If a bitly token file exists, we'll use that to shorten the link (and allow download counting). -if [ -f "bitly_token" ]; then - API=https://api-ssl.bitly.com/v4/bitlinks - # Request payload. In single quotes with double quotes escaped. :see_no_evil: - JSON='{\"domain\": \"bit.ly\",\"title\": \"${BINARY}.v${VERSION}-${ITERATION}.tgz\", \ - \"tags\": [\"${BINARY}\"], \"long_url\": \"${SOURCE_PATH}\"}' - # Request with headers and data. Using bash -c to hide token from bash -x in travis logs. - OUT=$(bash -c "curl -s -X POST -H 'Content-type: application/json' ${API} -H \"\$( ${BINARY}.rb.new - if [ "$?" = "0" ] && [ "$LINK" != "null?v=v${VERSION}" ] && [ "$LINK" != "?v=v${VERSION}" ]; then - mv ${BINARY}.rb.new ${BINARY}.rb - fi -fi - cp ${BINARY}.rb homebrew_release_repo/Formula pushd homebrew_release_repo git add Formula/${BINARY}.rb