circleci: Crudely clone a bit of is_travis logic.

This isn't really the right way to do this -- commit
  dcd80e665 "travis/setup-backend: Remove the '--travis' flag"
took us in the wrong direction by introducing more magic, deeper in
the stack.

But it's the same way we do it for Travis.  For now, just copy that.

[Thanks to hackerkid for cleaning up my original crude hack.]
This commit is contained in:
Greg Price
2017-12-01 15:47:56 -08:00
parent e8bf7d23bf
commit c83c118c6c

View File

@@ -42,9 +42,11 @@ COVERAGE_DIR_PATH = os.path.join(VAR_DIR_PATH, 'coverage')
LINECOVERAGE_DIR_PATH = os.path.join(VAR_DIR_PATH, 'linecoverage-report') LINECOVERAGE_DIR_PATH = os.path.join(VAR_DIR_PATH, 'linecoverage-report')
NODE_TEST_COVERAGE_DIR_PATH = os.path.join(VAR_DIR_PATH, 'node-coverage') NODE_TEST_COVERAGE_DIR_PATH = os.path.join(VAR_DIR_PATH, 'node-coverage')
is_travis = 'TRAVIS' in os.environ
is_circleci = 'CIRCLECI' in os.environ
# TODO: De-duplicate this with emoji_dump.py # TODO: De-duplicate this with emoji_dump.py
EMOJI_CACHE_PATH = "/srv/zulip-emoji-cache" EMOJI_CACHE_PATH = "/srv/zulip-emoji-cache"
is_travis = 'TRAVIS' in os.environ
if is_travis: if is_travis:
# In Travis CI, we don't have root access # In Travis CI, we don't have root access
EMOJI_CACHE_PATH = "/home/travis/zulip-emoji-cache" EMOJI_CACHE_PATH = "/home/travis/zulip-emoji-cache"
@@ -295,7 +297,7 @@ def main(options):
run(["scripts/setup/generate_secrets.py", "--development"]) run(["scripts/setup/generate_secrets.py", "--development"])
run(["tools/update-authors-json", "--use-fixture"]) run(["tools/update-authors-json", "--use-fixture"])
run(["tools/inline-email-css"]) run(["tools/inline-email-css"])
if is_travis and not options.is_production_travis: if is_circleci or (is_travis and not options.is_production_travis):
run(["sudo", "service", "rabbitmq-server", "restart"]) run(["sudo", "service", "rabbitmq-server", "restart"])
run(["sudo", "service", "redis-server", "restart"]) run(["sudo", "service", "redis-server", "restart"])
run(["sudo", "service", "memcached", "restart"]) run(["sudo", "service", "memcached", "restart"])