From 9306a9501b37a9215c65042a757a5ef2ca72b721 Mon Sep 17 00:00:00 2001 From: Adrien Chardon Date: Sun, 26 Oct 2014 18:21:02 +0100 Subject: [PATCH] Update deploy.sh + maintenance --- prod/deploy.sh | 16 ++++-- prod/gunicorn_start.sh | 0 prod/nginx-maintenance.conf | 4 +- templates/500.html | 111 ++++++++++++++++++++++++++++++++++++ templates/maintenance.html | 2 +- 5 files changed, 124 insertions(+), 9 deletions(-) mode change 100644 => 100755 prod/deploy.sh mode change 100644 => 100755 prod/gunicorn_start.sh create mode 100644 templates/500.html diff --git a/prod/deploy.sh b/prod/deploy.sh old mode 100644 new mode 100755 index 7d300ca..7800e23 --- a/prod/deploy.sh +++ b/prod/deploy.sh @@ -15,9 +15,9 @@ fi cd /opt/iteam-env/iteam-site/ # Maintenance mode -sudo rm /etc/nginx/sites-enabled/iteam -sudo ln -s /etc/nginx/sites-available/iteam-maintenance /etc/nginx/sites-enabled/iteam-maintenance -sudo service nginx reload +#sudo rm /etc/nginx/sites-enabled/iteam +#sudo ln -s /etc/nginx/sites-available/iteam-maintenance /etc/nginx/sites-enabled/iteam-maintenance +#sudo service nginx reload # Delete old branch if exists git checkout prod @@ -31,6 +31,10 @@ git checkout $1 # Create a branch with the same name - required to have version data in footer git checkout -b $1 +# compute front stuff +compass compile assets/ +python manage.py collectstatic --noinput + # Update application data source ../bin/activate pip install --upgrade -r requirements.txt @@ -41,9 +45,9 @@ deactivate sudo supervisorctl restart iteam # Exit maintenance mode -sudo rm /etc/nginx/sites-enabled/iteam-maintenance -sudo ln -s /etc/nginx/sites-available/iteam /etc/nginx/sites-enabled/iteam -sudo service nginx reload +#sudo rm /etc/nginx/sites-enabled/iteam-maintenance +#sudo ln -s /etc/nginx/sites-available/iteam /etc/nginx/sites-enabled/iteam +#sudo service nginx reload # Display current branch and commit git status diff --git a/prod/gunicorn_start.sh b/prod/gunicorn_start.sh old mode 100644 new mode 100755 diff --git a/prod/nginx-maintenance.conf b/prod/nginx-maintenance.conf index d8575a7..c47bb46 100644 --- a/prod/nginx-maintenance.conf +++ b/prod/nginx-maintenance.conf @@ -37,7 +37,7 @@ server { location / { client_max_body_size 100M; - return 503 //opt/iteam-env/iteam-site/templates/maintenance.html; + return 503 /opt/iteam-env/iteam-site/templates/maintenance.html; } @@ -45,7 +45,7 @@ server { error_page 500 501 502 503 504 /500.html; location = /500.html { - root //opt/iteam-env/iteam-site/templates/; + root /opt/iteam-env/iteam-site/templates/; } } diff --git a/templates/500.html b/templates/500.html new file mode 100644 index 0000000..bd89989 --- /dev/null +++ b/templates/500.html @@ -0,0 +1,111 @@ + + + + + + + + Erreur 500 · iTeam.org + + + + + + + + + + + + + + + + + +
+ + + +
+ Votre javascript semble désactivé. Ce site l'utilise avec parcimonie et + nous vous conseillons de le réactiver. +
+ + + + + +
+
+

+ Erreur 500 +

+

+ Le serveur n'a pas répondu a la requête, merci de réessayer dans quelques instants. +

+
+
+ + +
+ + + + diff --git a/templates/maintenance.html b/templates/maintenance.html index 2ad7f65..22349b1 100644 --- a/templates/maintenance.html +++ b/templates/maintenance.html @@ -72,7 +72,7 @@

Maintenance en cours ...

- Le site est actuellement en cours de maintenance et devrait repasser en ligne dans quelques minutes.@ + Le site est actuellement en cours de maintenance et devrait repasser en ligne dans quelques minutes.