Peg nginx-ensite to a commit

This commit is contained in:
Bob Mottram 2015-12-01 17:27:01 +00:00
parent cf35e77606
commit 2c7bca82b6
1 changed files with 40 additions and 2 deletions

View File

@ -94,6 +94,9 @@ DDNS_USERNAME=
DDNS_PASSWORD= DDNS_PASSWORD=
CURRENT_DDNS_DOMAIN= CURRENT_DDNS_DOMAIN=
NGINX_ENSITE_REPO="https://github.com/perusio/nginx_ensite"
NGINX_ENSITE_COMMIT='fa4d72ce1c0a490442c8474e9c8dc21ed52c93d0'
CLEANUP_MAILDIR_REPO="https://github.com/bashrc/cleanup-maildir" CLEANUP_MAILDIR_REPO="https://github.com/bashrc/cleanup-maildir"
CLEANUP_MAILDIR_COMMIT='33241d2e3861f901ba17f5c77ada007e1ec06a86' CLEANUP_MAILDIR_COMMIT='33241d2e3861f901ba17f5c77ada007e1ec06a86'
@ -891,6 +894,12 @@ function read_configuration {
if grep -q "GNUSOCIAL_COMMIT" $CONFIGURATION_FILE; then if grep -q "GNUSOCIAL_COMMIT" $CONFIGURATION_FILE; then
GNUSOCIAL_COMMIT=$(grep "GNUSOCIAL_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') GNUSOCIAL_COMMIT=$(grep "GNUSOCIAL_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
if grep -q "NGINX_ENSITE_REPO" $CONFIGURATION_FILE; then
NGINX_ENSITE_REPO=$(grep "NGINX_ENSITE_REPO" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "NGINX_ENSITE_COMMIT" $CONFIGURATION_FILE; then
NGINX_ENSITE_COMMIT=$(grep "NGINX_ENSITE_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi
if grep -q "CLEANUP_MAILDIR_COMMIT" $CONFIGURATION_FILE; then if grep -q "CLEANUP_MAILDIR_COMMIT" $CONFIGURATION_FILE; then
CLEANUP_MAILDIR_COMMIT=$(grep "CLEANUP_MAILDIR_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}') CLEANUP_MAILDIR_COMMIT=$(grep "CLEANUP_MAILDIR_COMMIT" $CONFIGURATION_FILE | awk -F '=' '{print $2}')
fi fi
@ -8078,6 +8087,7 @@ function email_archiving {
git checkout $CLEANUP_MAILDIR_COMMIT git checkout $CLEANUP_MAILDIR_COMMIT
git checkout -b $CLEANUP_MAILDIR_COMMIT git checkout -b $CLEANUP_MAILDIR_COMMIT
sed -i "s/cleanup-maildir commit.*/cleanup-maildir commit:$CLEANUP_MAILDIR_COMMIT/g" $COMPLETION_FILE sed -i "s/cleanup-maildir commit.*/cleanup-maildir commit:$CLEANUP_MAILDIR_COMMIT/g" $COMPLETION_FILE
cp $INSTALL_DIR/cleanup-maildir/cleanup-maildir /usr/bin
fi fi
else else
echo "cleanup-maildir commit:$GNUSOCIAL_COMMIT" >> $COMPLETION_FILE echo "cleanup-maildir commit:$GNUSOCIAL_COMMIT" >> $COMPLETION_FILE
@ -8092,7 +8102,7 @@ function email_archiving {
mkdir $INSTALL_DIR mkdir $INSTALL_DIR
fi fi
cd $INSTALL_DIR cd $INSTALL_DIR
git clone $CLEANUP_MAILDIR_REPO git clone $CLEANUP_MAILDIR_REPO $INSTALL_DIR/cleanup-maildir
git checkout $CLEANUP_MAILDIR_COMMIT git checkout $CLEANUP_MAILDIR_COMMIT
git checkout -b $CLEANUP_MAILDIR_COMMIT git checkout -b $CLEANUP_MAILDIR_COMMIT
if ! grep -q "cleanup-maildir commit" $COMPLETION_FILE; then if ! grep -q "cleanup-maildir commit" $COMPLETION_FILE; then
@ -8374,6 +8384,26 @@ function install_web_server {
if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" ]]; then if [[ $SYSTEM_TYPE == "$VARIANT_CHAT" ]]; then
return return
fi fi
# update to the next commit
if [ -d $INSTALL_DIR/nginx_ensite ]; then
if grep -q "Nginx-ensite commit" $COMPLETION_FILE; then
CURRENT_GNUSOCIAL_COMMIT=$(grep "Nginx-ensite commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_NGINX_ENSITE_COMMIT" != "$NGINX_ENSITE_COMMIT" ]]; then
cd /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
git stash
git checkout master
git pull
git checkout $NGINX_ENSITE_COMMIT
git checkout -b $NGINX_ENSITE_COMMIT
sed -i "s/Nginx-ensite commit.*/Nginx-ensite commit:$NGINX_ENSITE_COMMIT/g" $COMPLETION_FILE
make install
fi
else
echo "Nginx-ensite commit:$NGINX_ENSITE_COMMIT" >> $COMPLETION_FILE
fi
fi
if grep -Fxq "install_web_server" $COMPLETION_FILE; then if grep -Fxq "install_web_server" $COMPLETION_FILE; then
return return
fi fi
@ -8485,8 +8515,16 @@ function install_web_server {
mkdir $INSTALL_DIR mkdir $INSTALL_DIR
fi fi
cd $INSTALL_DIR cd $INSTALL_DIR
git clone https://github.com/perusio/nginx_ensite git clone $NGINX_ENSITE_REPO $INSTALL_DIR/nginx_ensite
cd $INSTALL_DIR/nginx_ensite cd $INSTALL_DIR/nginx_ensite
git checkout $NGINX_ENSITE_COMMIT
git checkout -b $NGINX_ENSITE_COMMIT
if ! grep -q "Nginx-ensite commit" $COMPLETION_FILE; then
echo "Nginx-ensite commit:$NGINX_ENSITE_COMMIT" >> $COMPLETION_FILE
else
sed -i "s/Nginx-ensite commit.*/Nginx-ensite commit:$NGINX_ENSITE_COMMIT/g" $COMPLETION_FILE
fi
make install make install
nginx_dissite default nginx_dissite default
echo 'install_web_server' >> $COMPLETION_FILE echo 'install_web_server' >> $COMPLETION_FILE