Skip to content

Commit

Permalink
use application name instead of server name for remote folder for sim…
Browse files Browse the repository at this point in the history
…ple app
  • Loading branch information
dotmobo committed Dec 31, 2015
1 parent 04ba794 commit 7d78506
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pydiploy/examples/simple_fabfile.py
Expand Up @@ -68,8 +68,8 @@ def test():
env.roledefs = {
'web': ['192.168.1.4']
}
env.server_name = 'myapp-folder'
env.goal = "test"
# env.server_name = "myapp.net" # optional: if you want to use an url for the name of the remote app folder instead of the application name (manual bottle or flask app)
env.map_settings = {
# uncomment to use :
#'ldap_user': "DATABASES['ldap']['USER']",
Expand All @@ -81,10 +81,10 @@ def test():
def prod():
"""Define prod stage"""
env.roledefs = {
'web': ['myapp.net']
'web': ['myserver.net']
}
env.server_name = 'myapp-folder'
env.goal = "prod"
# env.server_name = "myapp.net" # optional: if you want to use an url for the name of the remote app folder instead of the application name (manual bottle or flask app)
env.map_settings = {
# uncomment to use :
#'ldap_user': "DATABASES['ldap']['USER']",
Expand Down
5 changes: 3 additions & 2 deletions pydiploy/params.py
Expand Up @@ -97,7 +97,7 @@
'keep_releases': "number of old releases to keep",
'roledefs': "Role to use to deploy",
# 'backends': "backend to use to deploy",
'server_name': "name of webserver",
# 'server_name': "name of webserver",
# 'short_server_name': "short name of webserver",
# 'static_folder': "path of static folder",
'goal': "stage to use to deploy (dev,prod,test...)"
Expand Down Expand Up @@ -134,9 +134,10 @@
# 'circus_backend': 'name of the backend to use with circus',
# 'chaussette_backend': 'name of the backend to use with chaussette',
'run_tests_command': 'name of the command to run tests',
'remote_repo_specific_folder': 'specify a subfolder for the remote repository'
'remote_repo_specific_folder': 'specify a subfolder for the remote repository',
# 'remote_media_folder': "remote folder of the application's media files"
# 'media_folder': "path of the application's media files"
'server_name': "if you want to use an url for the name of the remote app folder instead of the application name (manual bottle or flask app)",
}

}
Expand Down
5 changes: 4 additions & 1 deletion pydiploy/prepare.py
Expand Up @@ -69,7 +69,10 @@ def build_env():
if "dest_path" not in env:
env.dest_path = env.local_tmp_dir

env.remote_project_dir = os.path.join(env.remote_home, env.server_name)
if "server_name" in env:
env.remote_project_dir = os.path.join(env.remote_home, env.server_name)
else:
env.remote_project_dir = os.path.join(env.remote_home, env.application_name)

if "tag" in env:
env.local_tmp_root_app = os.path.join(env.local_tmp_dir,
Expand Down
2 changes: 1 addition & 1 deletion pydiploy/require/system.py
Expand Up @@ -70,7 +70,7 @@ def set_timezone():
Sets the timezone
"""
if fabtools.system.distrib_id() not in('Ubuntu', 'Debian'):
print("Cannot deploy to non-debian/ubuntu host: %s" % env.server_name)
print("Cannot deploy to non-debian/ubuntu host")
return

return fabric.api.sudo("cp -f /usr/share/zoneinfo/%s /etc/localtime" % env.timezone)
Expand Down
2 changes: 0 additions & 2 deletions tools/pydiployfabfilesimple.sublime-snippet
Expand Up @@ -70,7 +70,6 @@ def test():
env.roledefs = {
'web': ['192.168.1.4']
}
env.server_name = 'myapp-folder'
env.goal = "test"
env.map_settings = {
# uncomment to use :
Expand All @@ -85,7 +84,6 @@ def prod():
env.roledefs = {
'web': ['myapp.net']
}
env.server_name = 'myapp-folder'
env.goal = "prod"
env.map_settings = {
# uncomment to use :
Expand Down

0 comments on commit 7d78506

Please sign in to comment.