Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/discourse/files/init-discourse

Issue 29347356: Issue 4234 - Migrate Discourse to a Docker-based setup (Closed)
Patch Set: Updated to Discourse 1.6.0 beta11 and increased memory size Created July 12, 2016, 4:56 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: modules/discourse/files/init-discourse
===================================================================
deleted file mode 100644
--- a/modules/discourse/files/init-discourse
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-
-import sys, os, pwd, subprocess
-
-app_dir = '/opt/discourse'
-
-# HOME environment variable isn't reliable when called via sudo
-home_dir = os.path.expanduser('~' + pwd.getpwuid(os.getuid()).pw_name)
-
-env = dict(os.environ)
-env['RAILS_ENV'] = 'production'
-
-# See http://meta.discourse.org/t/tuning-ruby-and-rails-for-discourse/4126
-env['RUBY_GC_MALLOC_LIMIT'] = '90000000'
-
-def callRailsCommand(command):
- subprocess.check_call(command, env=env, cwd=app_dir)
-
-def runInitCommands():
- service_path = '/etc/init.d/discourse'
-
- callRailsCommand(['bundle', 'install', '--deployment', '--without', 'test', '--without', 'development'])
- callRailsCommand(['bundle', 'exec', 'rake', 'db:migrate'])
- callRailsCommand(['bundle', 'exec', 'rake', 'assets:precompile'])
-
- if os.path.exists(service_path):
- subprocess.check_call(['sudo', service_path, 'stop'])
-
- if os.path.exists(service_path):
- subprocess.check_call(['sudo', service_path, 'start'])
-
-if __name__ == '__main__':
- runInitCommands()

Powered by Google App Engine
This is Rietveld