From 3ef9823a30e22c5addc70e5da2bdc9c0390ece7d Mon Sep 17 00:00:00 2001 From: Tuomas Suutari Date: Tue, 13 Feb 2018 17:47:51 +0200 Subject: [PATCH] Add update script hooks Add hooks for deployment/update script to run when updating the code to new version. --- post-update | 12 ++++++++++++ pre-update | 6 ++++++ 2 files changed, 18 insertions(+) create mode 100755 post-update create mode 100755 pre-update diff --git a/post-update b/post-update new file mode 100755 index 00000000..9ede5a77 --- /dev/null +++ b/post-update @@ -0,0 +1,12 @@ +#!/bin/sh +set -e + +pip install prequ==1.3.1 +prequ sync requirements.txt +./manage.py compilemessages +./manage.py collectstatic --noinput +./manage.py migrate --noinput + +if [ -x ../bin/update-notify ]; then + ../bin/update-notify "Succesfully updated to $new_ver" +fi diff --git a/pre-update b/pre-update new file mode 100755 index 00000000..8f397884 --- /dev/null +++ b/pre-update @@ -0,0 +1,6 @@ +#!/bin/sh +set -e + +if [ -x ../bin/update-notify ]; then + ../bin/update-notify "Updating from $prev_ver to $new_ver" +fi