diff --git a/pydiploy/examples/simple_fabfile.py b/pydiploy/examples/simple_fabfile.py index bedd7c8..642eceb 100644 --- a/pydiploy/examples/simple_fabfile.py +++ b/pydiploy/examples/simple_fabfile.py @@ -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']", @@ -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']", diff --git a/pydiploy/params.py b/pydiploy/params.py index a201eeb..bdb1f7c 100644 --- a/pydiploy/params.py +++ b/pydiploy/params.py @@ -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...)" @@ -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)", } } diff --git a/pydiploy/prepare.py b/pydiploy/prepare.py index f31772b..895a347 100644 --- a/pydiploy/prepare.py +++ b/pydiploy/prepare.py @@ -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, diff --git a/pydiploy/require/system.py b/pydiploy/require/system.py index 17fa149..614a00d 100644 --- a/pydiploy/require/system.py +++ b/pydiploy/require/system.py @@ -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) diff --git a/tools/pydiployfabfilesimple.sublime-snippet b/tools/pydiployfabfilesimple.sublime-snippet index 2c4d066..f9649ae 100644 --- a/tools/pydiployfabfilesimple.sublime-snippet +++ b/tools/pydiployfabfilesimple.sublime-snippet @@ -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 : @@ -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 :