mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
Run the following commands as root before deploying this branch: # /root/zulip/tools/migrate-server-config # rm /etc/zulip/machinetype /etc/zulip/server /etc/zulip/local /etc/humbug-machinetype /etc/humbug-server /etc/humbug-local (imported from commit aa7dcc50d2f4792ce33834f14761e76512fca252)
26 lines
654 B
Python
Executable File
26 lines
654 B
Python
Executable File
#!/usr/bin/python
|
|
import os
|
|
import ConfigParser
|
|
import platform
|
|
import re
|
|
|
|
config = ConfigParser.RawConfigParser()
|
|
config.add_section("machine")
|
|
|
|
with open('/etc/zulip/machinetype') as f:
|
|
machinetype = f.readline().strip()
|
|
|
|
config.set('machine', 'puppet_classes', "zulip-internal::%s" % (machinetype,))
|
|
|
|
if os.path.exists('/etc/zulip/server'):
|
|
if platform.node() == 'staging.zulip.net':
|
|
deploy_type = 'staging'
|
|
elif not not re.match(r'^test', platform.node()):
|
|
deploy_type = 'test'
|
|
else:
|
|
deploy_type = 'prod'
|
|
|
|
config.set('machine', 'deploy_type', deploy_type)
|
|
|
|
config.write(open('/etc/zulip/zulip.conf', 'w'))
|