From 3a8ecff3caa3f42e0aca7a54f9c844671c96566a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 13 Jan 2018 18:34:05 -0500 Subject: [PATCH] feat: add support for pushing packages to all known ubuntu versions --- contrib/release | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/contrib/release b/contrib/release index 4b05fea8f..e25acd01f 100755 --- a/contrib/release +++ b/contrib/release @@ -129,13 +129,28 @@ fn-version-next() { fn-publish-package() { declare desc="Publishes a package to packagecloud" declare IS_RELEASE="$1" RELEASE_TYPE="$2" PACKAGE_NAME="$3" - local REPOSITORY=dokku/dokku-betafish DIST=ubuntu/trusty + local REPOSITORY=dokku/dokku-betafish DIST=ubuntu EXIT_CODE=0 + local OS_ID ex [[ "$IS_RELEASE" == "true" ]] && REPOSITORY=dokku/dokku [[ "$RELEASE_TYPE" == "rpm" ]] && DIST=el/7 - log-info "(release-dokku) pushing ${RELEASE_TYPE} to packagecloud.com/${REPOSITORY}/${DIST}" - package_cloud push "${REPOSITORY}/${DIST}" "$PACKAGE_NAME" - return "$?" + + if [[ "$DIST" == "ubuntu" ]]; then + OS_IDS=("trusty" "utopic" "vivid" "wily" "xenial" "yakkety" "zesty" "artful" "bionic") + for OS_ID in "${OS_IDS[@]}"; do + log-info "(release-dokku) pushing ${RELEASE_TYPE} to packagecloud.com/${REPOSITORY}/${DIST}" + package_cloud push "${REPOSITORY}/${DIST}/${OS_ID}" "$PACKAGE_NAME" + ex="$?" + if [[ "$ex" -ne "0" ]]; then + EXIT_CODE="$ex" + fi + done + else: + log-info "(release-dokku) pushing ${RELEASE_TYPE} to packagecloud.com/${REPOSITORY}/${DIST}" + package_cloud push "${REPOSITORY}/${DIST}" "$PACKAGE_NAME" + EXIT_CODE="$?" + fi + return "$EXIT_CODE" } fn-replace-version() {