diff --git a/bootstrap.sh b/bootstrap.sh index b85faeab4..27e0190ac 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 @@ -104,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 " @@ -127,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 diff --git a/contrib/release b/contrib/release index 4b05fea8f..82322a862 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") + 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() { 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 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 diff --git a/docs/home.html b/docs/home.html index 44fc7ac71..2d9235fb5 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