Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import boto
- import urllib2
- from fabric.api import env, run, cd, sudo, local, parallel
- from fabric.operations import prompt, put
- from fabric.contrib.project import rsync_project
- import os
- import sys
- env.user = "server_user"
- env.hosts = ["remotehost.com"]
- env.key_filename = ["~/.ssh/fabriciofloreskey.pem"]
- @parallel
- def reload_nginx():
- sudo('service nginx restart')
- @parallel
- def start_nginx():
- sudo('service nginx start')
- @parallel
- def stop_nginx():
- sudo('service nginx stop')
- @parallel
- def deploy_frontend():
- local('cd ui && ng build --prod')
- rsync_project(local_dir='ui/dist', remote_dir='~/remote-dir')
- reload_nginx()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement