I am finishing off adding git+makefile driven deployments in devshop and need to trigger a "migrate" task in the front-end, and wait for it to finish.
The problem is that migrate task requires certain task_args to be present, but currently you cannot create task_args using the drush command "hosting-task"
To do this, I tried
drush @hostmaster hosting-task mysite.com migrate --platform=newplatform
but this didn't work because task_args are not passed at all in the hosting-task command.
We shouldn't pass all drush options as task_args, so I figured out that we can use drush arguments as 'name=value' pairs.
I was able to patch hosting-task command to parse extra drush arguments into task_args like so (The migrate task requires three task_args)
drush @hostmaster hosting-task mysite.com migrate target_platform=123 new_uri=mysite.com new_db_server=100
I'm including this patch in devshop because we need it to properly trigger a Migrate task after a git pull and a drush make.
Comments
Comment #3
helmo commentedneat
Comment #4
helmo commentedrtbc with one whitespace fix.
Comment #6
helmo commentedmerged
Comment #8
helmo commentedClosed an old duplicate of this in #1003536: allow arguments to hosting-task @site task
Comment #9
helmo commentedNot sure where to document this, but for tasks that require an argument (not option) you need to know some 'magic'.
drush @hostmaster hosting-task @platform_someplatform git-checkout checkout_git_ref=some-feature-branchWhen starting such a task via the UI code in drush_hosting_git_pre_hosting_task() handles this.
Or maybe we should stop using arguments in 4.x, and convert to options.