Skip to content

Commit

Permalink
foreman-puppet: use foreman-plugin.postist-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Nov 5, 2021
1 parent 94bfd04 commit e43387c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 35 deletions.
8 changes: 8 additions & 0 deletions plugins/ruby-foreman-puppet/debian/changelog
@@ -1,3 +1,11 @@
ruby-foreman-puppet (2.0.0~alpha.2-3) stable; urgency=low

* use foreman-plugin.postinst-lib from foreman
this requires at least foreman 3.1.0~, as that's the version
we introduced that library in

-- Evgeni Golov <evgeni@debian.org> Fri, 05 Nov 2021 07:51:52 +0100

ruby-foreman-puppet (2.0.0~alpha.2-2) stable; urgency=low

* don't run db:migrate in postinst
Expand Down
37 changes: 2 additions & 35 deletions plugins/ruby-foreman-puppet/debian/postinst
Expand Up @@ -10,46 +10,13 @@ else
fi

. /usr/share/debconf/confmodule

LOGFILE='/var/log/foreman-install.log'
PLUGIN='foreman_puppet'
. /usr/share/foreman/foreman-plugin.postinst-lib

# if this script aborts with an error dpkg can
# hang if daemons have been started
trap db_stop EXIT

BUNDLE=bundle
[ -h /usr/bin/foreman-ruby ] && BUNDLE="/usr/bin/foreman-ruby /usr/bin/bundle"

# Update gems
export HOME=/usr/share/foreman
cd /usr/share/foreman
if [ ! -z "${DEBUG}" ]; then
if [ -n "$2" ] ; then
$BUNDLE update $PLUGIN --local
else
$BUNDLE install --local --no-prune
fi
else
if [ -n "$2" ] ; then
$BUNDLE update $PLUGIN --local 2>&1 >> $LOGFILE
else
$BUNDLE install --local --no-prune 2>&1 >> $LOGFILE
fi
fi

if [ ! -z "${DEBUG}" ]; then
/usr/sbin/foreman-rake apipie:cache:index || true
else
/usr/sbin/foreman-rake apipie:cache:index >> $LOGFILE 2>&1 || true
fi

PLUGIN_ROOT=`$BUNDLE show $PLUGIN`
mkdir -p $PLUGIN_ROOT/public
ln -snf /var/lib/foreman/public/webpack/ $PLUGIN_ROOT/public/webpack

# Own all the core files
chown -Rf foreman:foreman '/usr/share/foreman'
foreman_plugin_install "foreman_puppet" "$2"

#DEBHELPER#

Expand Down

0 comments on commit e43387c

Please sign in to comment.