From a55fb34a77018c5226ecd3000c318a6abd6f5f76 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 13 Jan 2018 18:15:56 -0500 Subject: [PATCH 1/8] fix: allow bootstrap.sh to function properly against version 1.0.0+ Refs #2263 --- bootstrap.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 1accea4e3..912dcf592 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -46,13 +46,20 @@ install-dokku() { minor=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[2]}') patch=$(echo "$DOKKU_SEMVER" | awk '{split($0,a,"."); print a[3]}') + use_plugin=false + # 0.4.0 implemented a `plugin` plugin + if [[ "$major" -eq "0" ]] && [[ "$minor" -ge "4" ]] && [[ "$patch" -ge "0" ]]; then + use_plugin=true + elif [[ "$major" -ge "1" ]]; then + use_plugin=true + fi + # 0.3.13 was the first version with a debian package if [[ "$major" -eq "0" ]] && [[ "$minor" -eq "3" ]] && [[ "$patch" -ge "13" ]]; then install-dokku-from-package "$DOKKU_SEMVER" echo "--> Running post-install dependency installation" dokku plugins-install-dependencies - # 0.4.0 implemented a `plugin` plugin - elif [[ "$major" -eq "0" ]] && [[ "$minor" -ge "4" ]] && [[ "$patch" -ge "0" ]]; then + elif [[ "$use_plugin" == "true" ]]; then install-dokku-from-package "$DOKKU_SEMVER" echo "--> Running post-install dependency installation" sudo -E dokku plugin:install-dependencies --core From d43f9f730ff2cf08e5da6c904774bdfa99342080 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 13 Jan 2018 18:19:21 -0500 Subject: [PATCH 2/8] feat: support any ubuntu version Refs #2263 --- bootstrap.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 912dcf592..f8f9d7897 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -111,6 +111,7 @@ install-dokku-from-package() { install-dokku-from-deb-package() { local DOKKU_CHECKOUT="$1" local NO_INSTALL_RECOMMENDS=${DOKKU_NO_INSTALL_RECOMMENDS:=""} + local OS_ID if [[ -n $DOKKU_DOCKERFILE ]]; then NO_INSTALL_RECOMMENDS=" --no-install-recommends " @@ -134,9 +135,11 @@ install-dokku-from-deb-package() { add-apt-repository -y ppa:nginx/stable fi + OS_ID="$(lsb_release -cs 2> /dev/null || echo "trusty")" + echo "--> Installing dokku" wget -nv -O - https://packagecloud.io/gpg.key | apt-key add - - echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" | tee /etc/apt/sources.list.d/dokku.list + echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ $OS_ID main" | tee /etc/apt/sources.list.d/dokku.list apt-get update -qq > /dev/null [[ -n $DOKKU_VHOST_ENABLE ]] && echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | sudo debconf-set-selections From 3491d9eff2bf85b0c2e4565f198d123bbc88446f Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 13 Jan 2018 18:21:35 -0500 Subject: [PATCH 3/8] docs: reference the correct os version for installing the PPA Refs #2263 --- docs/home.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/home.html b/docs/home.html index 3e616bbea..175d1ee0a 100644 --- a/docs/home.html +++ b/docs/home.html @@ -135,7 +135,12 @@

$ - echo "deb $SOURCE trusty main" | tee /etc/apt/sources.list.d/dokku.list + export OS_ID="$(lsb_release -cs 2> /dev/null || echo "trusty")" +

+

+ + $ + echo "deb $SOURCE $OS_ID main" | tee /etc/apt/sources.list.d/dokku.list

From 251b781ecd1f4d4f7c3ea1158d68a80f9fa17a29 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 13 Jan 2018 18:24:10 -0500 Subject: [PATCH 4/8] feat: make deb installation aware of later ubuntu versions Refs #2263 --- deb.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deb.mk b/deb.mk index 0c6f0e7ac..3fc74b6a7 100644 --- a/deb.mk +++ b/deb.mk @@ -70,7 +70,7 @@ install-from-deb: @echo "--> Installing dokku" wget -nv -O - https://packagecloud.io/gpg.key | apt-key add - - @echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/dokku.list + @echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ $(shell lsb_release -cs 2> /dev/null || echo "trusty") main" | sudo tee /etc/apt/sources.list.d/dokku.list sudo apt-get update -qq > /dev/null sudo DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true apt-get install -yy dokku From 3a8ecff3caa3f42e0aca7a54f9c844671c96566a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 13 Jan 2018 18:34:05 -0500 Subject: [PATCH 5/8] 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() { From 1429c2d174995fbc34050e7284bcb5927a7832e9 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 13 Jan 2018 18:36:05 -0500 Subject: [PATCH 6/8] docs: add all supported ubuntu versions --- docs/getting-started/install/debian.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/getting-started/install/debian.md b/docs/getting-started/install/debian.md index 07a0da22d..c0359cd08 100644 --- a/docs/getting-started/install/debian.md +++ b/docs/getting-started/install/debian.md @@ -12,7 +12,8 @@ wget -nv -O - https://get.docker.com/ | sh # install dokku wget -nv -O - https://packagecloud.io/gpg.key | apt-key add - -echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ trusty main" | sudo tee /etc/apt/sources.list.d/dokku.list +OS_ID="$(lsb_release -cs 2> /dev/null || echo "trusty")" +echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ ${OS_ID} main" | sudo tee /etc/apt/sources.list.d/dokku.list sudo apt-get update -qq > /dev/null sudo apt-get install -qq -y dokku sudo dokku plugin:install-dependencies --core From 930094b45e83a04da7c849a74089ebbe5cee5e3b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 13 Jan 2018 18:38:51 -0500 Subject: [PATCH 7/8] chore: drop bionic --- contrib/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/release b/contrib/release index e25acd01f..ba84f17dc 100755 --- a/contrib/release +++ b/contrib/release @@ -136,7 +136,7 @@ fn-publish-package() { [[ "$RELEASE_TYPE" == "rpm" ]] && DIST=el/7 if [[ "$DIST" == "ubuntu" ]]; then - OS_IDS=("trusty" "utopic" "vivid" "wily" "xenial" "yakkety" "zesty" "artful" "bionic") + OS_IDS=("trusty" "utopic" "vivid" "wily" "xenial" "yakkety" "zesty" "artful") 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" From 7fd1c7f89d68a639ba01403ca711e9392a8fa4ef Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 13 Jan 2018 18:55:16 -0500 Subject: [PATCH 8/8] fix: remove extra colon --- contrib/release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/release b/contrib/release index ba84f17dc..82322a862 100755 --- a/contrib/release +++ b/contrib/release @@ -145,7 +145,7 @@ fn-publish-package() { EXIT_CODE="$ex" fi done - else: + else log-info "(release-dokku) pushing ${RELEASE_TYPE} to packagecloud.com/${REPOSITORY}/${DIST}" package_cloud push "${REPOSITORY}/${DIST}" "$PACKAGE_NAME" EXIT_CODE="$?"