Skip to content

Commit

Permalink
Add postinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
crohr committed Jul 8, 2014
1 parent 90765db commit af07024
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .pkgr.yml
@@ -1,2 +1,6 @@
addons:
- mysql
targets:
debian-7:
after_install: packaging/debian/postinst

36 changes: 36 additions & 0 deletions packaging/debian/postinst
@@ -0,0 +1,36 @@
#!/bin/sh

set -ex

# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "$1" in

configure)
rake_commands="db:migrate"
if [ "$2" = "" ]; then
rake_commands="${rake_commands} db:seed"
fi
rails-mysql-app run rake ${rake_commands}
;;

abort-upgrade|abort-remove|abort-deconfigure)
exit 0
;;

*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac

0 comments on commit af07024

Please sign in to comment.