Variables in hooks #630
Replies: 4 comments
-
Hi @marekmaurizio , ATM you can do a nice trick in order to have the URL: said that production:
<% prod_url = "http://sshwordmove.welaika.com" %>
vhost: <%= prod_url %>
wordpress_path: '/var/www/spam' # use an absolute path here
[...]
hooks:
push:
after:
local:
- 'curl -X "POST" "https://welaika.ryver.com/application/webhook/XXXXXXXXXXX" -H "Content-Type: text/plain; charset=utf-8" -d "Deploy su <%= prod_url %> terminato! :spock-hand:"'
Command line flags instead aren't accessible. Precisely: when This would be a totally new feature to design from ground up. Inside the class managing hooks execution, we have the flags passed by the user inside a hash:
That said I don't know - yet? - how to use them to produce something useful. Since I'd like to do real needs driven development, I'd ask if you mind to write down some examples about the interface you'd expect. The only approach I can imagine at the moment is to use magic placeholders, e.g.: hooks:
push:
after:
local:
- 'curl -X "POST" "https://welaika.ryver.com/application/webhook/XXXXXXXXXXX" -H "Content-Type: text/plain; charset=utf-8" -d "Deploy su <%= prod_url %> terminato! :spock-hand: \n Options used: %COMMAND_LINE_OPTIONS%"' expecting Wordmove to to a substitution on the
obtaining
Do you have better examples/ideas? Honestly I do not think this could be a priority feature, but a nice one, potentially opening in the future to extending the placeholders' dictionary and bringing more functionality to our beloved hooks, hence I'd take it in serious consideration. I hope to have helped you out a bit. Looking forward to receive your feedback. |
Beta Was this translation helpful? Give feedback.
-
Sure. My idea is to have a bot channel in slack where i can monitor what other members of the team are doing, and have a historical log. For instance:
Your example with magic placeholders would be perfect. That said, I don't feel it's a priority for the project, just something nice to have. I'll try to make a PR if I can, thank you. |
Beta Was this translation helpful? Give feedback.
This comment has been hidden.
This comment has been hidden.
-
Tagging as a feature; even if it's almost an idea I'd like to preserve it and not letting stale bot to close this one |
Beta Was this translation helpful? Give feedback.
-
Is it possible to know, in hooks, what we just did?
I would like to notify in Slack what a user did and on which website, so i need access to the parameters used in the command line (-pdwu for instance) and the url of the target.
Beta Was this translation helpful? Give feedback.
All reactions