-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apropos + cookies + errors pages 403 404 500 + maintenance
- Loading branch information
Showing
19 changed files
with
440 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
# | ||
# iTeam deployment script | ||
# | ||
# Deploys specified version of Zeste de Savoir | ||
# | ||
# Usage: | ||
# - This script has exactly 1 parameter : the tag name to deploy | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 <tag name>" >&2 | ||
exit 1 | ||
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 | ||
|
||
# Delete old branch if exists | ||
git checkout prod | ||
git branch -D $1 | ||
# Switch to new tag | ||
git fetch --tags | ||
# Server has git < 1.9, git fetch --tags doesn't retrieve commits... | ||
git fetch | ||
# Checkout the tag | ||
git checkout $1 | ||
# Create a branch with the same name - required to have version data in footer | ||
git checkout -b $1 | ||
|
||
# Update application data | ||
source ../bin/activate | ||
pip install --upgrade -r requirements.txt | ||
python manage.py migrate | ||
deactivate | ||
|
||
# Restart iteam | ||
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 | ||
|
||
# Display current branch and commit | ||
git status | ||
echo "Commit deployé : `git rev-parse HEAD`" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
# Redirect www.domain.tld to domain.tld | ||
#server { | ||
# listen 80; | ||
# server_name www.example.com; | ||
# | ||
# return 301 http://example.com$request_uri; | ||
#} | ||
|
||
server { | ||
listen 80; | ||
server_name beta.iteam.org; | ||
|
||
access_log /opt/iteam-env/log/nginx-access.log; | ||
error_log /opt/iteam-env/log/nginx-error.log; | ||
|
||
|
||
# media and static files | ||
|
||
location /static/ { | ||
alias /opt/iteam-env/iteam_static/; | ||
expires 1d; | ||
add_header Pragma public; | ||
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | ||
} | ||
|
||
location /media/ { | ||
alias /opt/iteam-env/media/; | ||
expires 1d; | ||
add_header Pragma public; | ||
add_header Cache-Control "public, must-revalidate, proxy-revalidate"; | ||
} | ||
|
||
|
||
# default : redirect to gunicorn (which will redirect to django) | ||
|
||
location / { | ||
client_max_body_size 100M; | ||
|
||
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/; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
[program:iteam] | ||
command = /opt/zdsenv/unicorn_start.sh ; | ||
command = /opt/iteam-env/iteam-site/gunicorn_start.sh ; | ||
user = nodraak ; | ||
stdout_logfile = /opt/zdsenv/logs/supervisor_stdout.log ; | ||
stderr_logfile = /opt/zdsenv/logs/supervisor_stderr.log ; | ||
stdout_logfile = /opt/iteam-env/log/supervisor_stdout.log ; | ||
stderr_logfile = /opt/iteam-env/log/supervisor_stderr.log ; | ||
redirect_stderr = true ; | ||
autorestart = true ; | ||
autostart = true ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{% extends "base.html" %} | ||
|
||
{% load staticfiles %} | ||
|
||
{% block title_app %} | ||
Erreur 404 | ||
{% endblock %} | ||
|
||
{% block breadcrumb_page %} | ||
<li class="current"><a href="#">Erreur 404</a></li> | ||
{% endblock %} | ||
|
||
|
||
{% block content %} | ||
|
||
<div class="row"> | ||
<div class="large-12 columns"> | ||
{# title #} | ||
<div class="home-app-title"> | ||
<div class="row"> | ||
<div class="large-12 columns"> | ||
<h1> | ||
Erreur 404 | ||
</h1> | ||
</div> | ||
</div> | ||
</div> | ||
{# content #} | ||
<div class="row"> | ||
<div class="large-12 columns"> | ||
<p> | ||
La page demandée n'a pas été trouvée. | ||
</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.