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.
30 lines
546 B
30 lines
546 B
# -*- coding: utf-8 -*-
|
|
|
|
from fabric.api import * # noqa
|
|
from deploy.common import BRANCH, PROJECT_NAME
|
|
from 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_update():
|
|
with cd(PROJECT_DIR):
|
|
run('docker-compose build')
|
|
run('docker-compose down')
|
|
run('docker-compose up -d')
|
|
|
|
|
|
@task
|
|
def update():
|
|
pull()
|
|
docker_update()
|
|
|