feedhenry / negotiator

Apache License 2.0
2 stars 3 forks source link

Environment services [WIP] #9

Closed maleck13 closed 7 years ago

maleck13 commented 7 years ago

@wtrocki @philbrookes change to use template files instead of programatically creating templates. This is first step towards a poc for environment services: ignore first commit just extra and updated vendor deps. main changes here: https://github.com/feedhenry/negotiator/commit/ad17f2d8a18aec7e9abeee7d7e7774320b244bcf The templates are golang templates so can easily be reused. Should be relatively easy to add more Lot more work to do but if you were to checkout this branch and do the following you would get an environment cache and and environment node cloudapp.

export REPO_DIR=<Negotiator Sourc Dir>/resources/templates
go build .
./negotiator
oc new-project se
curl http://localhost:3000/deploy/se/cloudapp -H Content-type:application/json -d '{"repo": {"loc": "https://github.com/feedhenry/testing-cloud-app.git","ref": "master"}, "target":{"host":"AN OPENSHIFT MASTER","token":"AN OPENSHIFT TOKEN"}, "serviceName": "cloudapp4","replicas": 1,  "projectGuid":"test","envVars":[{"name":"test","value":"test"}]}'

curl http://localhost:3000/deploy/se/cache -H Content-type:application/json -d '{"serviceName": "cache","replicas": 1,  "projectGuid":"test", "target":{"host":"AN OPENSHIFT MASTER","token":"AN OPENSHIFT TOKEN"}}'