Commit 88351a3a authored by Ernesto Rodriguez Ortiz's avatar Ernesto Rodriguez Ortiz
Browse files

Avoid crash if docker-compose.yml don't exist and add --delete to the rsync.

parent 19a4266e
Pipeline #1833 failed with stages
in 39 seconds
......@@ -32,14 +32,28 @@ env.locale = False
# Get info of the current docker-compose services.
# Services see docker-compose.yml
with open('{}/docker-compose.yml'.format(env.workspace), 'r') as stream:
try:
config = yaml.load(stream, Loader=yaml.Loader)
env.services = {}
for service in config['services']:
env.services[service] = service
except yaml.YAMLError as e:
print(e)
try:
env.services = {}
with open('{}/docker-compose.yml'.format(env.workspace), 'r') as stream:
try:
config = yaml.load(stream, Loader=yaml.Loader)
for service in config['services']:
env.services[service] = service
except yaml.YAMLError as e:
print(e)
except IOError as e:
# Initialize the env.services with default values so drupalizer don't fail
# when listing available commands.
env.services = {
'db_server': 'db_server',
'php': 'php',
'web_server': 'web_Server'
}
print(e)
print("ERROR: Drupalizer-3.x will not work without the "
"docker-compose.yml configuration file of your Drupal project. "
"\n\r **Drupalizer is used as a submodule to automatize task and "
"you cannot use it as a stand alone project.")
# Site
......
......@@ -184,9 +184,9 @@ def _rsync_platform(target, target_directory):
Helper function to rsync platform to server.
"""
local('rsync -a --exclude sites/*/settings.php --exclude sites/*/files '
'src/drupal/ {}@{}:{}'.format(target.get('user'),
target.get('host'),
target_directory))
'--delete src/drupal/ {}@{}:{}'.format(target.get('user'),
target.get('host'),
target_directory))
def _aegir_provision_platform(platform, aegir_path, aegir_destsrv):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment