def deploy():
with prefix(". /usr/local/bin/virtualenvwrapper.sh; workon perdiem"):
previous_commit_hash = run("git log -1 --format=\"%H\" --no-color", pty=False)
run("git pull")
cmd_changes_deployed = "git log {previous_hash}.. --reverse --format=\"%h : %an : %s\" --no-color".format(
previous_hash=previous_commit_hash
)
changes_deployed = run(cmd_changes_deployed, pty=False)
run("pip install -r ../requirements.txt")
run("python manage.py migrate")
run("python manage.py collectstatic --no-input")
sudo("sv restart perdiem")
send_notification(changes_deployed)
评论列表
文章目录