Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

drushcommand script does not run correctly #192

Open
EmlynK opened this issue May 2, 2018 · 0 comments
Open

drushcommand script does not run correctly #192

EmlynK opened this issue May 2, 2018 · 0 comments
Assignees
Labels

Comments

@EmlynK
Copy link
Contributor

EmlynK commented May 2, 2018

When the backup parameter is passed into the script from a Jenkins job, it's passed in as a string rather than a boolean (this actually applies to all parameters).

So when backup=False is passed, the backup variable is set. That means, if when it's set to False, the following if statement is satisfied:

# Take a database backup first if told to.
if backup:
db_name = Drupal.get_db_name(shortname, branch, "default")
execute(common.MySQL.mysql_backup_db, db_name, 'drush_command', True)

The execute(common.MySQL.mysql_backup_db, db_name, 'drush_command', True) call fails to run because the app_primary role hasn't been defined:

deployments/common/MySQL.py

Lines 126 to 129 in 76df37b

# Take a database backup
@task
@roles('app_primary')
def mysql_backup_db(db_name, build, fail_build=False, mysql_config='/etc/mysql/debian.cnf'):


So, the solution here is we need ensure the backup parameter is a boolean and we need to define the app_primary role. I do not think we can use the common.Utils.define_roles() function to do this because a config.ini file does not exist. I think we can simply set that role in the fabfile-drushcommand.py script.

@EmlynK EmlynK added the bug label May 2, 2018
@EmlynK EmlynK self-assigned this May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant