Merge lp:~ricardokirkner/locolander/fix-deploy into lp:locolander

Proposed by Ricardo Kirkner
Status: Needs review
Proposed branch: lp:~ricardokirkner/locolander/fix-deploy
Merge into: lp:locolander
Prerequisite: lp:~ricardokirkner/locolander/django-supervisor
Diff against target: 93 lines (+13/-10) (has conflicts)
4 files modified
docker/scripts/locolander (+4/-0)
fabfile.py (+1/-1)
locolander/locolanderweb/tasks.py (+5/-5)
locolander/supervisord.conf (+3/-4)
Text conflict in locolander/locolanderweb/tasks.py
To merge this branch: bzr merge lp:~ricardokirkner/locolander/fix-deploy
Reviewer Review Type Date Requested Status
LocoLanderos Pending
Review via email: mp+180669@code.launchpad.net

Commit message

various fixes for real deployment issues

To post a comment you must log in.

Unmerged revisions

37. By Ricardo Kirkner

fixes to supervisor config

36. By Ricardo Kirkner

use proper path to locolander script

35. By Ricardo Kirkner

avoid bzr diff aborting locolander script

34. By Ricardo Kirkner

better output from script

33. By Ricardo Kirkner

replace subprocess with envoy

use envoy instead of subprocess, because the latter fails to run properly
when celeryd is started under supervisor.

32. By Ricardo Kirkner

customized model repr strings

31. By Ricardo Kirkner

use absolute path for database file

30. By Ricardo Kirkner

better output handling

29. By Ricardo Kirkner

disable autoreload

28. By Ricardo Kirkner

added envoy and django-supervisor as dependencies

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docker/scripts/locolander'
2--- docker/scripts/locolander 2013-08-16 23:23:30 +0000
3+++ docker/scripts/locolander 2013-08-16 23:23:30 +0000
4@@ -33,6 +33,9 @@
5 cd target
6 OUTPUT=$(bzr merge $SOURCE 2>&1)
7
8+# ignore any errors here as bzr diff will exit with code 1
9+# if the diff is not empty
10+set +e
11 # figure out if there are any changes
12 DIFF=$(bzr diff)
13 CONFLICTS=$(bzr conflicts)
14@@ -47,6 +50,7 @@
15 echo "SUCCESS - Nothing to do."
16 exit 0
17 fi
18+set -e
19
20 # 3. build image using config file
21 echo "Building project image..."
22
23=== modified file 'fabfile.py'
24--- fabfile.py 2013-08-16 23:23:30 +0000
25+++ fabfile.py 2013-08-16 23:23:30 +0000
26@@ -24,7 +24,7 @@
27
28 @virtualenv
29 def run():
30- manage('supervisor')
31+ manage('supervisor -d')
32
33
34 @virtualenv
35
36=== modified file 'locolander/locolanderweb/tasks.py'
37--- locolander/locolanderweb/tasks.py 2013-08-16 23:23:30 +0000
38+++ locolander/locolanderweb/tasks.py 2013-08-16 23:23:30 +0000
39@@ -3,7 +3,6 @@
40 import subprocess
41 from datetime import datetime
42 =======
43-from datetime import datetime
44 >>>>>>> MERGE-SOURCE
45
46 import envoy
47@@ -26,11 +25,12 @@
48 author = request.author
49 message = request.commit_message
50
51+ cwd = os.path.dirname(os.path.abspath(__file__))
52+ script = os.path.abspath(os.path.join(cwd, '..', '..',
53+ 'docker', 'scripts', 'locolander'))
54 cmd = '{script} {project} {source} {target} "{message}" "{author}"'.format(
55- script=os.path.join(os.path.abspath(os.curdir),
56- 'docker', 'scripts', 'locolander'),
57- project=project.name, source=source, target=target, message=message,
58- author=author)
59+ script=script, project=project.name, source=source, target=target,
60+ message=message, author=author)
61
62 r = envoy.run(cmd)
63 output = r.std_out
64
65=== modified file 'locolander/supervisord.conf'
66--- locolander/supervisord.conf 2013-08-16 23:23:30 +0000
67+++ locolander/supervisord.conf 2013-08-16 23:23:30 +0000
68@@ -1,6 +1,5 @@
69 [program:gunicorn]
70-command = gunicorn -b 0.0.0.0:8000 locolander.wsgi:application
71-directory = {{ PROJECT_DIR }}
72+command = gunicorn locolander.wsgi:application
73 autostart = true
74 autorestart = true
75 stdout_logfile = supervisord.log
76@@ -8,7 +7,7 @@
77
78 [program:redis]
79 command = redis-server
80-autostart = true
81+autostart = false
82 autorestart = true
83 stdout_logfile = supervisord.log
84 redirect_stderr = true
85@@ -22,7 +21,7 @@
86
87 [program:flower]
88 command = {{ PYTHON }} {{ PROJECT_DIR }}/manage.py celery flower
89-autostart = true
90+autostart = false
91 autorestart = true
92 stdout_logfile = supervisord.log
93 redirect_stderr = true

Subscribers

People subscribed via source and target branches

to all changes: