Skip to content

Instantly share code, notes, and snippets.

@jewzaam
Last active August 29, 2015 14:11
Show Gist options
  • Save jewzaam/6b6ac2a66fd73971b5ab to your computer and use it in GitHub Desktop.
Save jewzaam/6b6ac2a66fd73971b5ab to your computer and use it in GitHub Desktop.
deploy openshift-lightblue-cart via REST API
# setup
OS_USERNAME=<user>
OS_PASSWORD=<password>
OS_GEAR_SIZE="medium"
# verify you can get application list
curl -k -X GET https://openshift.redhat.com/broker/rest/domain/lightblue/applications --user $OS_USERNAME:$OS_PASSWORD
# delete existing app, get ID from app list above
curl -k -X DELETE https://openshift.redhat.com/broker/rest/application/<ID> --user $OS_USERNAME:$OS_PASSWORD
# create new application called 'citest'
curl -k -X POST https://openshift.redhat.com/broker/rest/domain/lightblue/applications \
--data-urlencode name=citest \
--data-urlencode cartridges[][url]=https://raw.githubusercontent.com/jewzaam/openshift-lightblue-cart/master/metadata/manifest.yml \
--data-urlencode scale=false \
--data-urlencode gear_size=$OS_GEAR_SIZE \
--user $OS_USERNAME:$OS_PASSWORD
@jewzaam
Copy link
Author

jewzaam commented Dec 19, 2014

I wanted to explore ways to automatically deploy lightblue somewhere for testing. With our openshift cart standing up the latest version is easy, but there are some gotya's. I did find a jenkins plugin for this but it's an artifact deployment to core carts. It doesn't support downloadable carts. Bummer. Next option is using rhc tool, but versions change and you will get prompted for password if tokens have expired. The next (and last?) option is calling the REST API directly. This is stable and requires auth every time. The issue I have is storage of credientials. I don't want to put my openshift password on a shared machine (jenkins) even if it's an internal instance and a work openshift account.

Where I am right now is done with testing out the API's. They work. They're well documented. Maybe if I get some time I can look at moving forward with this. Or someone else..

@jewzaam
Copy link
Author

jewzaam commented Dec 19, 2014

Note the gear size selected is 'medium'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment