Merge pull request #3146 from dokku/fix-non-ubuntu-release

Fix non ubuntu installs
This commit is contained in:
Jose Diaz-Gonzalez
2018-04-07 14:20:48 -04:00
committed by GitHub
8 changed files with 110 additions and 105 deletions

View File

@@ -38,17 +38,6 @@ all:
install: dependencies version copyfiles plugin-dependencies plugins
release: deb-all rpm-all package_cloud packer
package_cloud:
package_cloud push dokku/dokku/ubuntu/trusty herokuish*.deb
package_cloud push dokku/dokku/ubuntu/trusty sshcommand*.deb
package_cloud push dokku/dokku/ubuntu/trusty plugn*.deb
package_cloud push dokku/dokku/ubuntu/trusty dokku*.deb
package_cloud push dokku/dokku/el/7 herokuish*.rpm
package_cloud push dokku/dokku/el/7 sshcommand*.rpm
package_cloud push dokku/dokku/el/7 plugn*.rpm
package_cloud push dokku/dokku/el/7 dokku*.rpm
packer:
packer build contrib/packer.json

View File

@@ -108,6 +108,16 @@ install-dokku-from-package() {
esac
}
in-array() {
declare desc="return true if value ($1) is in list (all other arguments)"
local e
for e in "${@:2}"; do
[[ "$e" == "$1" ]] && return 0
done
return 1
}
install-dokku-from-deb-package() {
local DOKKU_CHECKOUT="$1"
local NO_INSTALL_RECOMMENDS=${DOKKU_NO_INSTALL_RECOMMENDS:=""}
@@ -136,10 +146,26 @@ install-dokku-from-deb-package() {
fi
OS_ID="$(lsb_release -cs 2> /dev/null || echo "trusty")"
if ! in-array "$DOKKU_DISTRO" "debian" "ubuntu"; then
DOKKU_DISTRO="ubuntu"
OS_ID="trusty"
fi
if [[ "$DOKKU_DISTRO" == "ubuntu" ]]; then
OS_IDS=("trusty" "utopic" "vivid" "wily" "xenial" "yakkety" "zesty" "artful" "bionic")
if ! in-array "$OS_ID" "${OS_IDS[@]}"; then
OS_ID="trusty"
fi
elif [[ "$DOKKU_DISTRO" == "debian" ]]; then
OS_IDS=("wheezy" "jessie" "stretch" "buster")
if ! in-array "$OS_ID" "${OS_IDS[@]}"; then
OS_ID="stretch"
fi
fi
echo "--> Installing dokku"
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -
echo "deb https://packagecloud.io/dokku/dokku/ubuntu/ $OS_ID main" | tee /etc/apt/sources.list.d/dokku.list
echo "deb https://packagecloud.io/dokku/dokku/$DOKKU_DISTRO/ $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

View File

@@ -136,7 +136,18 @@ fn-publish-package() {
[[ "$RELEASE_TYPE" == "rpm" ]] && DIST=el/7
if [[ "$DIST" == "ubuntu" ]]; then
OS_IDS=("trusty" "utopic" "vivid" "wily" "xenial" "yakkety" "zesty" "artful")
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
DIST=debian
OS_IDS=("wheezy" "jessie" "stretch" "buster")
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"
@@ -289,7 +300,7 @@ fn-require-bin() {
main() {
declare RELEASE="$1"
local CURRENT_VERSION NEXT_VERSION IS_RELEASE major minor patch versions
local CURRENT_VERSION NEXT_VERSION IS_RELEASE
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish")
if [[ "$RELEASE" == '--trace' ]]; then
@@ -317,20 +328,15 @@ main() {
fn-repo-update "$IS_RELEASE" "$CURRENT_VERSION" "$NEXT_VERSION"
fn-build-dokku "$IS_RELEASE" "$NEXT_VERSION"
[[ "$?" == 0 ]] || log-fail "Error building package"
fn-build-dokku "$IS_RELEASE" "$NEXT_VERSION" || log-fail "Error building package"
fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_amd64.deb"
[[ "$?" == 0 ]] || log-fail "Error extracting deb package"
fn-extract-package "$IS_RELEASE" "dokku_${NEXT_VERSION}_amd64.deb" || log-fail "Error extracting deb package"
fn-extract-package "$IS_RELEASE" "dokku-${NEXT_VERSION}-1.x86_64.rpm"
[[ "$?" == 0 ]] || log-fail "Error extracting rpm package"
fn-extract-package "$IS_RELEASE" "dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error extracting rpm package"
fn-publish-package "$IS_RELEASE" "deb" "dokku_${NEXT_VERSION}_amd64.deb"
[[ "$?" == 0 ]] || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "deb" "dokku_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "rpm" "dokku-${NEXT_VERSION}-1.x86_64.rpm"
[[ "$?" == 0 ]] || log-fail "Error publishing rpm package"
fn-publish-package "$IS_RELEASE" "rpm" "dokku-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
fn-repo-push-tags "$IS_RELEASE"
}

View File

@@ -53,14 +53,40 @@ fn-extract-package() {
fn-publish-package() {
declare desc="Publishes a package to packagecloud"
declare RELEASE="$1" RELEASE_TYPE="$2" PACKAGE_NAME="$3"
local REPOSITORY=dokku/dokku-betafish DIST=ubuntu/trusty
declare IS_RELEASE="$1" RELEASE_TYPE="$2" PACKAGE_NAME="$3"
local REPOSITORY=dokku/dokku-betafish DIST=ubuntu
local OS_ID ex
[[ "$RELEASE" != "betafish" ]] && REPOSITORY=dokku/dokku
[[ "$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-update) 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
DIST=debian
OS_IDS=("wheezy" "jessie" "stretch" "buster")
for OS_ID in "${OS_IDS[@]}"; do
log-info "(release-dokku-update) 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-update) pushing ${RELEASE_TYPE} to packagecloud.com/${REPOSITORY}/${DIST}"
package_cloud push "${REPOSITORY}/${DIST}" "$PACKAGE_NAME"
EXIT_CODE="$?"
fi
return "$EXIT_CODE"
}
fn-in-array() {
@@ -73,6 +99,17 @@ fn-in-array() {
return 1
}
fn-is-release() {
declare desc="Checks if a given run is a release run"
declare RELEASE="$1"
local IS_RELEASE=false
if [[ "$RELEASE" == "major" ]] || [[ "$RELEASE" == "minor" ]] || [[ "$RELEASE" == "patch" ]]; then
IS_RELEASE=true
fi
echo "$IS_RELEASE"
}
fn-require-bin() {
declare desc="Checks that a binary exists"
declare BINARY="$1"
@@ -83,7 +120,7 @@ fn-require-bin() {
main() {
declare RELEASE="$1"
local CURRENT_VERSION NEXT_VERSION major minor patch versions
local NEXT_VERSION
local VALID_RELEASE_LEVELS=("major" "minor" "patch" "betafish")
if [[ "$RELEASE" == '--trace' ]]; then
@@ -105,6 +142,7 @@ main() {
[[ -n "$PACKAGECLOUD_API_TOKEN" ]] || log-fail "Missing PACKAGECLOUD_API_TOKEN environment variable"
NEXT_VERSION="$(grep DOKKU_UPDATE_VERSION deb.mk | head -n1 | cut -d'=' -f2 | xargs)"
IS_RELEASE="$(fn-is-release "$RELEASE")"
fn-build-dokku || log-fail "Error building package"
@@ -112,10 +150,9 @@ main() {
fn-extract-package "dokku-update-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error extracting rpm package"
fn-publish-package "$RELEASE" "deb" "dokku-update_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
fn-publish-package "$RELEASE" "rpm" "dokku-update-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
fn-publish-package "$IS_RELEASE" "deb" "dokku-update_${NEXT_VERSION}_amd64.deb" || log-fail "Error publishing deb package"
fn-publish-package "$IS_RELEASE" "rpm" "dokku-update-${NEXT_VERSION}-1.x86_64.rpm" || log-fail "Error publishing rpm package"
}
main "$@"

View File

@@ -4,60 +4,23 @@ Dokku is released in intervals *at most* three weeks apart, though may be releas
To propose a release, the following tasks need to be performed:
- Update all blockquote references of `not yet released and only available in master` to point to release version.
- The installable version must be changed in the `contrib/dokku-installer.py` file.
- The installable version must be changed in the `debian/control` file.
- The installable version must be changed in the `docs/home.html` file
- The installable version must be changed in the `docs/installation.md` file.
- The installable version must be changed in the `docs/template.html` file.
- The installable version must be changed in the `README.md` file.
- The embedded css should be cleared in the `docs/template.html` file.
- The versioned links should be updated in the `docs/assets/favicons/browserconfig.xml` file.
- The versioned links should be updated in the `docs/assets/favicons/manifest.json` file.
- The versioned links should be updated in the `docs/assets/style.css` file.
- The versioned links should be updated in the `docs/home.html` file.
- The versioned links should be updated in the `docs/template.html` file.
- The versioned links should be updated or added to the `docs/assets/versions.json` file.
- A list of changes must be made in the `HISTORY.md`.
- A tag must be created locally with your release version
- Debian and RPM packages *must* be created via `vagrant up build`
- The packages should be uploaded to packagecloud.io
- All changes are pushed to master and the tag should be turned into a release which will contain the changelog.
- ArchLinux package description *must* be updated via `vagrant up build-arch` (needs to be done after the tag is pushed to GitHub, because it is based on that)
```shell
export PACKAGECLOUD_API_TOKEN=SOME_TOKEN
# supports major/minor/patch/betafish
contrib/release
```
> If you are a maintainer and need the PACKAGECLOUD_API_TOKEN in order to make a release, please contact @josegonzalez to get this information.
As well, the ArchLinux package description *must* be updated via `vagrant up build-arch` (needs to be done after the tag is pushed to GitHub, because it is based on that)
## Versioning
Dokku follows semver standards. As we are not yet at a stable release, breaking changes will require *only* a minor release, while all other changes only require a patch release. Once we hit stable, breaking changes will require a major release.
Tags should be created via the following method:
```shell
git tag v0.9.9
```
At the moment, tags need not be signed, though that may change in the future.
## Debian and RPM packages
The `build` target in the Dokku `Vagrantfile` creates debian and rpm packages for Dokku at a point in time. The version will be based upon the latest local tag - you may create your own, internal tags/releases if that is so desired.
Debian package information is held in the `debian` directory of the Dokku project.
For the public project, releases should be pushed to packagecloud.io *after* a tag is created but *before* said tag is pushed to github. The following may be the release workflow:
```shell
git tag v0.9.9
vagrant up build
export PACKAGECLOUD_TOKEN=SOME_TOKEN
package_cloud push dokku/dokku/ubuntu/trusty dokku_0.9.9_amd64.deb
package_cloud push dokku/dokku/el/7 dokku-0.9.9-1.x86_64.rpm
```
If new versions of other packages were created, these should also be pushed at this time.
> If you are a maintainer and need the PACKAGECLOUD_TOKEN in order to make a release, please contact @josegonzalez to get this information.
## ArchLinux Packages
ArchLinux packages are not really build, because all that is needed for an Arch User Repo (AUR) package is the description of how to build the package. To make this process as easy as possible there is a vagrant box called `build-arch` that updates the version of this build description (a file called `PKGBUILD`), then runs some helper scripts to fill all additional information and does test if the package could be build. Then only those changes need to be pushed to the AUR repo and an updated version of the package is ready for usage for our ArchLinux users. For detailed information see the section below.
@@ -76,29 +39,7 @@ git push aur master
> If you are a maintainer and need access to the AUR repositories in order to make a release, please contact @morrisjobke or @josegonzalez to get this co-maintainership.
## Changelog format
The `HISTORY.md` should be added to based on the changes made since the previous release. This can be done by reviewing all merged pull requests to the master branch on github. The format is as follows:
```
## 0.9.9
Some description concerning major changes in this release, or potential incompatibilities.
### New Features
- #SOME_ID: @pull-request-creator Description
### Bug Fixes
- #SOME_ID: @pull-request-creator Description
### Docs Changes
- #SOME_ID: @pull-request-creator Description
```
## Detailed information for ArchLinux packages
### Detailed information for ArchLinux packages
All of the information to build the ArchLinux package is in the AUR git repository (see [dokku AUR page](https://aur.archlinux.org/packages/dokku/)). The release of a AUR package only consists of pushing the package information into the AUR git repo. Then users could use that information to build the package on their machines.

View File

@@ -13,6 +13,7 @@ wget -nv -O - https://get.docker.com/ | sh
# install dokku
wget -nv -O - https://packagecloud.io/gpg.key | apt-key add -
OS_ID="$(lsb_release -cs 2> /dev/null || echo "trusty")"
echo "trusty utopic vivid wily xenial yakkety zesty artful bionic" | grep -q "$OS_ID" || OS_ID="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

View File

@@ -137,6 +137,11 @@
<span class="prompt">$</span>
<span class="command">export OS_ID="$(lsb_release -cs 2> /dev/null || echo "trusty")"</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>
<span class="command">echo "trusty utopic vivid wily xenial yakkety zesty artful bionic" | grep -q "$OS_ID" || OS_ID="trusty"</span>
</p>
<p class="line">
<span class="path"></span>
<span class="prompt">$</span>

View File

@@ -1,4 +1,4 @@
[plugin]
description = "dokku core scheduler-docker-local plugin"
version = "0.11.3"
version = "0.11.6"
[plugin.config]