You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

49 lines
815 B

# -*- coding: utf-8 -*-
# flake8: noqa
from fabric.api import *
from conf.deploy.common import BRANCH, PROJECT_NAME
from conf.deploy.stage import HOSTS, USER, PASS
PROJECT_DIR = f'projects/{PROJECT_NAME}'
env.user = USER
env.password = PASS
env.hosts = HOSTS
@task
def pull():
with cd(PROJECT_DIR):
run(f'git pull origin {BRANCH}')
@task
def docker_rebuild():
with cd(PROJECT_DIR):
run('docker-compose build')
run('docker-compose down')
run('docker-compose up -d')
@task
def docker_restart():
with cd(PROJECT_DIR):
run('docker-compose restart web')
@task
def docker_bash():
with cd(PROJECT_DIR):
run('docker-compose exec web bash')
@task
def upgrade():
pull()
docker_rebuild()
@task
def update():
pull()
docker_restart()