Fabric deploy command invalid type
dcramer opened this issue · comments
undefined method `join' for "fab -R production deploy:branch_name=master":String
This is due to local_log_file:
unless last_child.success?
fail StandardError "Task failed: #{cmds.join(" ")}"
end
I'm not a rubyist so my fix is to remove support for this
My change above wasn't enough as it breaks the string interpolation
We use the fabric provider on a daily basis, including the ENV configuration. Not sure why you're having a problem with it.
@brentc I no longer have the full traceback, but this specifically is due to local_log_file:
unless last_child.success?
fail StandardError "Task failed: #{cmds.join(" ")}"
end
In all fairness this might be a false positive. I'm sort of just guessing at how to actually get heaven working by digging into code (the docs are pretty far from even being usable).
Seems lots of the error handling code is problematic, this also straight up fails with another error:
undefined method `StandardError' for #<Heaven::Provider::Fabric:0x007f8468a46ef8>
I think that line probably needs a comma. Unfortunately I don't use fabric in my projects. Do you need a hand working through the stacktrace or can you send a PR with your changes? I'd rather not remove the env var override if possible.
@atmos The other examples suggest a different format for commands (i.e. the command split according to shell interp. vs a string of the command). It's possible I'm misinterpreting things, but I think the actual issue here is likely the logger itself.
For now I'm reverting my changes and will dig through the stderr logs that get posted to gist to work through "what do we need to do to make it actually work"
Ah, it looks like all the other usages of execute_and_log
pass a list [..., ...]
structure, but line 38 of the fabric provider is passing in a string:
log "Executing fabric: #{deploy_command}"
execute_and_log(deploy_command)
As I implemented the provider, this is my mistake. It would appear this only causes a problem when there's an actual problem running the fabric command (and is being thrown to the logger) since, as I noted above, we use this code to deploy several times a day.
I suspect changing the line to
execute_and_log([deploy_command])
Would resolve the issue with the logger.