Closed diegoroccia closed 8 years ago
This was one of the feature we are working on internally. For the moment, you might be able to request the API using a script.
You can change the reload command to call a script that does:
Here's an idea of what you might do if you need to set in the config if you wanted to generate an nginx config file:
"HAProxy": {
"TemplatePath": "/etc/bamboo/nginx_template.cfg",
"OutputPath": "/etc/nginx/nginx.conf",
"ReloadCommand": "nginx -s reload",
"ReloadValidationCommand": "nginx -c /etc/nginx/nginx.conf -t"
},
I don't know what service you're deploying, but let us know if there's any functionality you need from bamboo.
Thanks a lot for your replies
My need would be to have multiple configuration files generated. I was aware of the 2 solutions you guys proposed (thanks) but I think it would be great to have something like:
"Outputs": [ "HAProxy": { "TemplatePath": "/etc/bamboo/nginx_template.cfg", "OutputPath": "/etc/nginx/nginx.conf", "ReloadCommand": "nginx -s reload", "ReloadValidationCommand": "nginx -c /etc/nginx/nginx.conf -t" }, "ServiceMappings": { "TemplatePath": "/etc/bamboo/servicemappings.cfg", "OutputPath": "/etc/sysconfig/servicemappings.cfg", "ReloadCommand": "kill -HUP somepid", }, "Someotherfile": { "TemplatePath": "/etc/bamboo/someotherfile.cfg", "OutputPath": "/etc/someotherfile.cfg", } ]
and so on, an arbitrary number of files generated. As your code has no real "dependency" on haproxy, I think it would be smart to abstract all of this.
@activars I just re-read your reply and I realised I missed the "we're working on this" feature! so can we wait for this feature to arrive? thanks!
Yeah, multiple output files is a needed feature, even for haproxy, with things like green-blue deploys making zero downtime reloads much easier. I'll open a seperate issue for that
Hi! is it possible to use bamboo to create other configuration files than haproxy ones? I would like to export a json file to be used by other services
thanks