Skip to content
Snippets Groups Projects
Select Git revision
  • 6b724c8fce31d5e70eae4eacc1a7d32b3e73b6a7
  • noblogs default
  • noblogs-5.7.1
  • upstream
  • noblogs-5.7
  • noblogs-5.6new
  • upstream5.5.1
  • noblogs28dic
  • upstream28dic
  • noblogs-5.5.1
  • noblogs-5.4.2
  • noblogs-5.4_seconda
  • noblogs-5.4
  • noblogs-7c
  • wp5.2.3p3
  • mergedbconf
  • noblogs-5.7.1
  • noblogs.5.7.0p1
  • noblogs-5.7.0
  • noblogs-5.6p3
  • noblogs5.6p2
  • noblogs-5.6p1
  • noblogs-5.6
  • noblogs-5.4.2p1
  • noblogs-5.4.2
  • noblogs-5.4.1
  • noblogs-5.4
  • noblogs-p5.4
  • noblogs-5.3.2p2
  • noblogs-5.3.2p1
  • noblogs-5.3.2
  • noblogs-5.3
  • noblogs-5.2.3p4
  • noblogs-5.2.3p3
  • noblogs-5.2.3p2
  • noblogs-5.2.3p1
36 results

class-wp-customize-manager.php

Blame
  • fabfile.py 1.77 KiB
    from fabric.api import *
    import fabric.contrib.project as project
    import os
    import sys
    import SimpleHTTPServer
    import SocketServer
    
    # Local path configuration (can be absolute or relative to fabfile)
    env.deploy_path = 'output'
    DEPLOY_PATH = env.deploy_path
    
    # Remote server configuration
    production = 'root@localhost:22'
    dest_path = '/var/www'
    
    # Rackspace Cloud Files configuration settings
    env.cloudfiles_username = 'my_rackspace_username'
    env.cloudfiles_api_key = 'my_rackspace_api_key'
    env.cloudfiles_container = 'my_cloudfiles_container'
    
    
    def clean():
        if os.path.isdir(DEPLOY_PATH):
            local('rm -rf {deploy_path}'.format(**env))
            local('mkdir {deploy_path}'.format(**env))
    
    def build():
        local('pelican -s pelicanconf.py')
    
    def rebuild():
        clean()
        build()
    
    def regenerate():
        local('pelican -r -s pelicanconf.py')
    
    def serve():
        os.chdir(env.deploy_path)
    
        PORT = 8000
        class AddressReuseTCPServer(SocketServer.TCPServer):
            allow_reuse_address = True
    
        server = AddressReuseTCPServer(('', PORT), SimpleHTTPServer.SimpleHTTPRequestHandler)
    
        sys.stderr.write('Serving on port {0} ...\n'.format(PORT))
        server.serve_forever()
    
    def reserve():
        build()
        serve()
    
    def preview():
        local('pelican -s publishconf.py')
    
    def cf_upload():
        rebuild()
        local('cd {deploy_path} && '
              'swift -v -A https://auth.api.rackspacecloud.com/v1.0 '
              '-U {cloudfiles_username} '
              '-K {cloudfiles_api_key} '
              'upload -c {cloudfiles_container} .'.format(**env))
    
    @hosts(production)
    def publish():
        local('pelican -s publishconf.py')
        project.rsync_project(
            remote_dir=dest_path,
            exclude=".DS_Store",
            local_dir=DEPLOY_PATH.rstrip('/') + '/',
            delete=True,
            extra_opts='-c',
        )