sbin/sync/fabric.py.tmpl
author ymh <ymh.work@gmail.com>
Sat, 30 Jun 2018 00:51:43 +0200
changeset 9 d15e18c2dab2
parent 1 3b0a8a6e685e
permissions -rw-r--r--
Add blessings to the sync requirements
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
from fabric.api import env
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
from random import choice
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
env.hosts = ['<user>@<server>']
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
env.web_group = 'iri'
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
env.folders = ['log', 'static/media']
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
env.repos = {'iconolab' : {'repo':"<path to repo>", 'src_root':'src', 'requirements': 'requirements/prod.txt', 'python_version': '3.5'}}
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
env.base_export_path = "/tmp"
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
env.export_prefix = "iconolab"
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
env.key = 'iconolab'
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
env.remote_path = {
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
    'web':"/etc/www/iconolab/",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
    'src':"/etc/www/iconolab",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
    'virtualenv':"/srv/virtualenv/iconolab",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
    'build_export':"/tmp/build",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
    'pythonpath' : ['/etc/www/iconolab']
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
}
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
#env.remote_path = {
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
#    'web':"/var/www/iconolab/",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
#    'src':"/Users/ymh/dev/tmp/testfab/src",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
#    'virtualenv':"/Users/ymh/dev/tmp/testiconolab/virtualenv/iconolab",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
#    'build_export':"/tmp/build",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
#    'pythonpath' : ['/etc/www/iconolab']
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
#}
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
env.platform_web_module = "iconolab"
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
env.remote_baseline_venv = ""
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    33
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
env.rsync_filters = {
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
    'src' : [
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
        "P .htpasswd",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
        "P .htaccess",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
        "P egonomy/config.py",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
    ],
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    40
    'web': [
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    41
        "+ core",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
        "P .htpasswd",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
        "P .htaccess",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
        "P robots.txt",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
        "P env/***",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    46
        "P log/***",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    47
        "P index/***",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    48
        "P static/media/***",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    49
        "P crossdomain.xml",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    50
    ],
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    51
    'venv': [
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    52
        "+ core",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    53
    ]
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    54
}
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    55
env.web_relaunch_cmd = "supervisorctl restart iconolab"
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    56
env.settings = "iconolab_settings"
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
env.admin_cmd = "django-admin"
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
env.check_folder_access = False
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
env.config = {
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
    'web': {
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
        'base_url': "/",
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
        'web_url': 'http://egonomy.iri-resesarch.org',
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
        'db_engine':'postgresql_psycopg2',
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
        'db_name':'platform',
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
        'db_user': 'iriuser',
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
        'db_password': '',
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
        'db_host': 'sql.iri.centrepompidou.fr',
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
        'db_port': 5432,
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
        'haystack_url' : 'http://localhost:9200',
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
        'haystack_index' : 'egonomy',
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
        'log_file' : env.remote_path['web'] + '/log/log.txt',
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
        'secret_key' : ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)]),
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
    },
3b0a8a6e685e * Move importcollection and importmetacategories commands to the generic project
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
}