add deploy for staging

prod
Dmitriy Shesterkin 9 years ago
parent 2ea2d1a71e
commit c59f9995ed
  1. 4
      .gitignore
  2. 4
      deploy/common.py
  3. 4
      deploy/stage.py
  4. 7
      deploy/stage.py.example
  5. 30
      fabfile.py
  6. 2
      requirements/local.txt

4
.gitignore vendored

@ -10,6 +10,9 @@ conf/env
!form.html
/static/vendor
# deploy settings
/deploy/stage.py
######################All system################################################
# Compiled source #
###################
@ -196,3 +199,4 @@ target/
*.css.map
################################################################################

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
PROJECT_NAME = 'dokumentor'
REPO = 'git@bitbucket.org:Air51/dokumentor_dev.git'
BRANCH = 'develop'

@ -0,0 +1,4 @@
# -*- coding: utf-8 -*-
USER = 'mitri4'
PASS = '9091324913Dasha'
HOSTS = ['mitri4.pro:8022']

@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
from deploy.common import * # noqa
USER = 'username'
PASS = 'password'
HOSTS = ['domain_name:ssh_port']

30
fabfile.py vendored

@ -0,0 +1,30 @@
# -*- 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()

@ -5,3 +5,5 @@ sqlparse==0.2.3
django-eml-email-backend==0.1
ipdb==0.10.3
ptpython==0.39
Fabric3==1.13.1.post1
Jinja2==2.9.6

Loading…
Cancel
Save