GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stackphp.com/fabfile.py at master · h4cc/stackphp.com

Expand file tree

/

fabfile.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
57 lines (48 loc) · 1.53 KB
/

fabfile.py

Copy path

File metadata and controls

57 lines (48 loc) · 1.53 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from fabric.api import *
from fabric.utils import abort
from fabric.contrib.project import rsync_project
from fabric.contrib.files import exists
if not env.hosts:
env.hosts = ['[email protected]']
project_name = 'stackphp.com'
target_dir = '/var/www/'+project_name
backup_dir = target_dir+'-backup'
staging_dir = target_dir+'-staging'
@task(default=True)
def deploy():
puts('> Cleaning up previous backup and staging dir')
run('rm -rf %s %s' % (backup_dir, staging_dir))
puts('> Preparing staging')
run('cp -r %s %s' % (target_dir, staging_dir))
puts('> Uploading changes')
with cd(staging_dir):
with hide('stdout'):
extra_opts = '--omit-dir-times'
rsync_project(
env.cwd,
'./',
delete=True,
exclude=['.git', '*.pyc'],
extra_opts=extra_opts,
)
puts('> Switching changes to live')
run('mv %s %s' % (target_dir, backup_dir))
run('mv %s %s' % (staging_dir, target_dir))
@task
def rollback():
if exists(backup_dir):
puts('> Rolling back to previous deploy')
run('mv %s %s' % (target_dir, staging_dir))
run('mv %s %s' % (backup_dir, target_dir))
else:
abort('Rollback failed, no backup exists')
@task
def reload():
puts('> Reloading nginx and php5-fpm')
run('service nginx reload')
run('service php5-fpm reload')
@task
def restart():
puts('> Restarting nginx and php5-fpm')
run('service nginx restart')
run('service php5-fpm restart')
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.