-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Adds support for ArchLinux as host OS #1918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| .PHONY: arch-all arch-dokku | ||
|
|
||
| arch-all: arch-dokku | ||
| echo "Done" | ||
|
|
||
| arch-setup: | ||
| echo "-> Updating pacman repository and installing package helper" | ||
| sudo pacman -Sy | ||
| sudo pacman -S --needed --noconfirm pkgbuild-introspection | ||
|
|
||
| echo "-> Download, build and install cower (dependency of pacaur) and pacaur" | ||
| curl -so /tmp/cower.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/cower.tar.gz | ||
| curl -so /tmp/pacaur.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/pacaur.tar.gz | ||
| tar -xzf /tmp/cower.tar.gz -C /tmp | ||
| tar -xzf /tmp/pacaur.tar.gz -C /tmp | ||
| gpg --recv-key 1EB2638FF56C0C53 | ||
| cd /tmp/cower; makepkg -sri --noconfirm | ||
| cd /tmp/pacaur; makepkg -sri --noconfirm | ||
|
|
||
| echo "-> Installing build requirements" | ||
| pacaur --noconfirm --noedit -S plugn | ||
|
|
||
| arch-dokku: arch-setup | ||
| echo "-> Update package sums, create metadata file and test the build of the package" | ||
| git describe --tags > /tmp/VERSION | ||
| cat /tmp/VERSION | cut -d '-' -f 1 | cut -d 'v' -f 2 > /tmp/STABLE_VERSION | ||
| sed -i -e "s/pkgver=.*/pkgver=`cat /tmp/STABLE_VERSION`/" /dokku-arch/PKGBUILD | ||
| cd /dokku-arch; updpkgsums; mksrcinfo; makepkg -fd | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ To propose a release, the following tasks need to be performed: | |
| - Debian 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) | ||
|
|
||
| ## Versioning | ||
|
|
||
|
|
@@ -56,6 +57,24 @@ If new versions of other packages were created, these should also be pushed at t | |
|
|
||
| > If you are a maintainer and need the PACKAGECLOUD_TOKEN in order to make a release, please contact @josegonzalez to get this information. | ||
|
|
||
| ## ArchLinux Pacakages | ||
|
|
||
| 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 aditional 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. | ||
|
|
||
| The workflow looks like this: | ||
|
|
||
| ```shell | ||
| # having dokku-arch in ../dokku-arch | ||
| vagrant up build-arch | ||
| # wait for "==> build-arch: ==> Finished making: dokku 0.4.14-2 (Mon Feb 22 23:20:37 CET 2016)" | ||
| cd ../dokku-arch | ||
| git add PKGBUILD .SRCINFO | ||
| git commit -m 'Update to dokku 0.9.9' | ||
| 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: | ||
|
|
@@ -77,3 +96,28 @@ Some description concerning major changes in this release, or potential incompat | |
|
|
||
| - #SOME_ID: @pull-request-creator Description | ||
| ``` | ||
|
|
||
| ## 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. | ||
|
|
||
| To update the package clone the repository and adjust the files in the repository. Then a helper script - `updpkgsums` - to update the SHA sum could be called (check against the original SHA sum). Another helper script - `mksrcinfo` - needs to be called to update the meta information of the package in a file called `.SRCINFO`. The next step builds the package locally for verification - `makepkg`. As last step commit your changes and push the commit. | ||
|
|
||
| * dependencies are defined in the `depends` attribute in `PKGBUILD` | ||
| * build steps during package build time are defined in the `package()` method in `PKGBUILD` | ||
| * steps that should be executed during install/update/remove time are defined in the file `dokku.install` | ||
| * detailed information about all attributes in `PKGBUILD` could be found in the [ArchLinux wiki](https://wiki.archlinux.org/index.php/PKGBUILD) | ||
| * detailed information about the AUR workflow could be found in the [AUR article](https://wiki.archlinux.org/index.php/Arch_User_Repository) in the ArchLinux wiki | ||
|
|
||
| That is the usual workflow: | ||
|
|
||
| ```shell | ||
| updpkgsums # update sha sums - compare them with the original ones | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these commands only available on arch?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes - and the derivates, because they come with the package manager.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you update the Vagrantfile so I can have a vm for running these arch commands?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. $ pacman -Qo /usr/bin/updpkgsums
/usr/bin/updpkgsums ist in pacman 5.0.0-1 enthalten
$ pacman -Qo /usr/bin/makepkg
/usr/bin/makepkg ist in pacman 5.0.0-1 enthalten
$ pacman -Qo /usr/bin/mksrcinfo
/usr/bin/mksrcinfo ist in pkgbuild-introspection 8-1 enthalten
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Where should the Vagrant file go? Because the build information is in a different repo (see below - the AUR repo).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you hop on slack so we can discuss this? |
||
| mksrcinfo # update package metadata for AUR | ||
| makepkg # test package builds | ||
| git add PKGBUILD .SRCINFO | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These files should also be here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should know, that you then need to copy them between git repos then - I would keep them in the AUR repo only. Those commands should be executed in the AUR git repo clone.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah but I'm basically going to git push to both the github repo and the arch repo.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But that are different repos 😕 This is what the AUR repo contains: https://aur.archlinux.org/cgit/aur.git/tree/?h=dokku
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah gotcha. Okay, I will create a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure :) |
||
| git commit -m 'Update to dokku 0.9.9' | ||
| git push | ||
| ``` | ||
|
|
||
| > If there is something unclear simply ask @morrisjobke for help. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ if [[ ! -f "$DOKKU_ROOT/VHOST" ]]; then | |
| [[ $(dig +short "$(< "$DOKKU_ROOT/HOSTNAME")") ]] && cp "$DOKKU_ROOT/HOSTNAME" "$DOKKU_ROOT/VHOST" | ||
| fi | ||
|
|
||
| dokku_path=$(which dokku) | ||
|
|
||
| # temporary hack for https://github.com/dokku/dokku/issues/82 | ||
| # redeploys all apps after a reboot | ||
| if [[ $(/sbin/init --version 2> /dev/null) =~ upstart ]]; then | ||
|
|
@@ -19,7 +21,7 @@ start on filesystem and started docker | |
|
|
||
| script | ||
| sleep 2 # give docker some time | ||
| sudo -i -u dokku /usr/local/bin/dokku ps:restore | ||
| sudo -i -u dokku $dokku_path ps:restore | ||
| end script | ||
| EOF | ||
| fi | ||
|
|
@@ -33,7 +35,7 @@ After=docker.target | |
| [Service] | ||
| Type=simple | ||
| User=dokku | ||
| ExecStart=/usr/local/bin/dokku ps:restore | ||
| ExecStart=$dokku_path ps:restore | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @michaelshobbs @josegonzalez I added the changes to this file to fix the restore process on ArchLinux. It works there just fine and should also work without issues on all other platforms.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where is the file located on arch linux?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. binaries on arch usually reside in |
||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What calls this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn ... I removed this to speed up the test runs :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.