drone-now
drone-now copied to clipboard
Add support for using a local now.json
- Checks for
local_configparameter (usuallynow.jsonin the pipeline step. If it exists, it uses the options set in the file and ignores any duplicate parameters in the pipeline step (e.g. if"name"innow.jsonanddeploy_name:in.drone.ymlare both set it uses "name" fromnow.json) - If "alias" is set in
now.jsonthe plugin runs thealiascommand - If "scale" is set in
now.jsonthe plugin runs thescalecommand - If local_config is not set, it functions just the same
Other Notes
- Changed code style
if <condition>
then
<block>
fi
to if <condition>; then
- Update to DOCS.md
- Clarify how to use
scale:parameter in docs - The full list of config features are documented here. Additional features may be used in the now.json that are not accessible with the current options in the plugin.
Hi @one000mph,
I'm not sure, but does the parameters of now override the now.json config ?
If you set flags on the CLI e.g. now -n my-deploy-name -A now.json and have
# now.json
{
"name": "a-different-name"
}
now will use the name set by -n "my-deploy-name". Running now on the CLI, however, does not mirror the behavior of this plugin. I tried to make that clear in the Docs file. If you examine the plugin code, you will see that the command run when local_config is set does not include a -n flag. If you compare L34 https://github.com/andyet/drone-now/blob/8660b392d44316ff90d4a2338c5c46f6f2682333/script.sh#L34 with L54 https://github.com/andyet/drone-now/blob/8660b392d44316ff90d4a2338c5c46f6f2682333/script.sh#L54 you will see that difference. I'd welcome any other feedback that you have on the code. Right now the plugin assumes that if you set local_config all parameters which can be set in now.json are set there including the name of the deployment, alias, scale parameters, etc. It will ignore a duplicate parameter in the drone config if it exists. If you have additional feedback on my code, or suggestions on how to make this behavior more clear please let me know.