Skip to content

Commit

Permalink
Update deploy.sh + maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
Nodraak committed Oct 26, 2014
1 parent d100163 commit 9306a95
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 9 deletions.
16 changes: 10 additions & 6 deletions prod/deploy.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
Empty file modified prod/gunicorn_start.sh
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions prod/nginx-maintenance.conf
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ 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;
}


# Error pages

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/;
}
}

111 changes: 111 additions & 0 deletions templates/500.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@


<!DOCTYPE html>
<html lang="fr" class="no-js">
<head>
<meta charset="utf-8" />

<title>Erreur 500 &#183; iTeam.org</title>

<meta name="language" content="fr">
<meta http-equiv="content-language" content="fr">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="iTeam.org est le site d'une association de l'ECE pour la promotion du logiciel libre et de l'open source : par exemple le navigateur Firefox, la suite OpenOffice ou le système Linux.">

<link href="/static/stylesheets/app.css" media="all" rel="stylesheet" type="text/css" />

<script src="/static/javascripts/vendor/custom.modernizr.js"></script>

<link rel="shortcut icon" type="image/png" href="/static/images/favicon.ico" />

</head>

<!--
#################################################################
# #
# ##### ##### ##### ### # # ### #### #### #
# # # # # # ## ## # # # # # #
# # # #### ##### # ## # # # #### # ## #
# # # # # # # # # # # # # # #
# ##### # ##### # # # # # ### # # ### #
# #
#################################################################
FYI : You just lost the Game ! <3
-->

<body>
<div id="h"></div>

<!--[if lt IE 8]>
<div class="browsehappy">
Vous utilisez un navigateur dépassé. Merci de
<a href="http://browsehappy.com/">mettre à jour celui-ci</a> pour
améliorer votre expérience.
</div>
<![endif]-->

<div class="warning_js">
Votre javascript semble désactivé. Ce site l'utilise avec parcimonie et
nous vous conseillons de le réactiver.
</div>


<nav class="top-bar" data-topbar>
<ul class="title-area">
<li class="name">
<a href="/">
<span>
<img src="/static/images/logo_light.png" alt="logo_light" />
</span>
</a>
</li>
</ul>
</nav>


<div class="row">
<div class="large-12 columns">
<h2>
Erreur 500
</h2>
<p>
Le serveur n'a pas répondu a la requête, merci de réessayer dans quelques instants.
</p>
</div>
</div>


<hr />
<footer class="row">
<div class="large-6 columns">
<p>
iTeam 2014 - <a href="https://github.com/Nodraak/iteam-site">Open source</a>
</p>
</div>
<div class="large-6 columns hide-for-medium hide-for-large hide-for-xlarge hide-for-xxlarge">
<ul class="inline-list left">
<li><a href="/pages/apropos/">À propos</a></li>
<li><a href="http://irc.iteam.org">IRC</a></li>
<li><a href="http://ece.fr">ECE</a></li>
<li><a href="/pages/">Plus</a></li>
<li><a href="#h"></a></li>

</ul>
</div>
<div class="large-6 columns hide-for-small">
<ul class="inline-list right">
<li><a href="/pages/apropos/">À propos</a></li>
<li><a href="http://irc.iteam.org">IRC</a></li>
<li><a href="http://ece.fr">ECE</a></li>
<li><a href="/pages/">Plus</a></li>
<li><a href="#h"></a></li>

</ul>
</div>
</footer>

</body>
</html>
2 changes: 1 addition & 1 deletion templates/maintenance.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h2>
Maintenance en cours ...
</h2>
<p>
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.
</p>
</div>
</div>
Expand Down

0 comments on commit 9306a95

Please sign in to comment.