<commit_before>import time
from fabric.api import run, execute, env

environment = "production"

env.use_ssh_config = True
env.hosts = ["christmas"]

branch = "master"
repo = "<EMAIL>:isitchristmas/web.git"

username = "christmas"
home = "/home/christmas/web"
logs = "/home/christmas/log"
shared_path = "%s/shared" % home
version_path = "%s/versions/%s" % (home, time.strftime("%Y%m%d%H%M%S"))
current_path = "%s/current" % home


# can be run only as part of deploy

def checkout():
  run('git clone -q -b %s %s %s' % (branch, repo, version_path))

def links():
  run("ln -s %s/config.js %s/config.js" % (shared_path, version_path))

def make_current():
  # run('rm -f %s && ln -s %s %s' % (current_path, version_path, current_path))
  run('rm -rf %s && cp -r %s %s' % (current_path, version_path, current_path))

def prune_releases():
  pass


## can be run on their own

def start():
  run("cd %s && NODE_ENV=%s forever -l %s/forever.log -a start app.js" % (current_path, environment, logs))

def stop():
  run("forever stop app.js")

def restart():
  run("forever restart app.js")

def deploy():
  execute(checkout)

  execute(links)
  execute(make_current)

  # execute(stop)
  # execute(start)
  execute(restart)<commit_msg>full stop and start for now<commit_after>import time
from fabric.api import run, execute, env

environment = "production"

env.use_ssh_config = True
env.hosts = ["christmas"]

branch = "master"
repo = "<EMAIL>:isitchristmas/web.git"

username = "christmas"
home = "/home/christmas/web"
logs = "/home/christmas/log"
shared_path = "%s/shared" % home
version_path = "%s/versions/%s" % (home, time.strftime("%Y%m%d%H%M%S"))
current_path = "%s/current" % home


# can be run only as part of deploy

def checkout():
  run('git clone -q -b %s %s %s' % (branch, repo, version_path))

def links():
  run("ln -s %s/config.js %s/config.js" % (shared_path, version_path))

def make_current():
  # run('rm -f %s && ln -s %s %s' % (current_path, version_path, current_path))
  run('rm -rf %s && cp -r %s %s' % (current_path, version_path, current_path))

def prune_releases():
  pass


## can be run on their own

def start():
  run("cd %s && NODE_ENV=%s forever -l %s/forever.log -a start app.js" % (current_path, environment, logs))

def stop():
  run("forever stop app.js")

def restart():
  run("forever restart app.js")

def deploy():
  execute(checkout)
  execute(links)
  execute(make_current)
  execute(stop)
  execute(start)
{'fraction_non_alphanumeric': 0.16986525112290732, 'fraction_numerical': 0.0, 'mean_word_length': 4.314533622559653, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7000765', 'n_tokens_mistral': 931, 'n_tokens_neox': 901, 'n_words': 253}