Skip to content

Instantly share code, notes, and snippets.

@david-martin
Last active June 11, 2018 11:54
Show Gist options
  • Save david-martin/b79a29c722cf8297fe72d186cbc10039 to your computer and use it in GitHub Desktop.
Save david-martin/b79a29c722cf8297fe72d186cbc10039 to your computer and use it in GitHub Desktop.
Usage: `./use_tag.sh 1.0.0-alpha`
#!/bin/sh
set -x
TAG=$1
oc patch deployment webconsole -n openshift-web-console -p "{\"spec\": {\"template\": {\"spec\": {\"containers\": [{\"name\": \"webconsole\", \"image\": \"aerogear/origin-web-console:$TAG\"}]}}}}"
oc get configmap broker-config -n ansible-service-broker -o yaml | sed -e "s/tag:.*/tag: \"$TAG\"/" | oc replace -n ansible-service-broker -f -
for i in `oc get clusterserviceplan --no-headers | awk '{ print $1 }'`; do oc delete clusterserviceplan $i; done
for i in `oc get clusterserviceclass --no-headers | awk '{ print $1 }'`; do oc delete clusterserviceclass $i; done
# For `apb` cli installation see https://github.com/ansibleplaybookbundle/ansible-playbook-bundle/blob/master/docs/apb_cli.md#installing-the-apb-tool
#apb relist
oc scale dc/asb --replicas=0 -n ansible-service-broker && oc scale dc/asb --replicas=1 -n ansible-service-broker
sleep 10
# svcat for macos
#
# curl -sLO https://download.svcat.sh/cli/latest/darwin/amd64/svcat
# chmod +x ./svcat
# mv ./svcat /usr/local/bin/
# svcat version --client
#
# svcat for linux
#
# curl -sLO https://download.svcat.sh/cli/latest/linux/amd64/svcat
# chmod +x ./svcat
# mv ./svcat /usr/local/bin/
# svcat version --client
svcat sync broker ansible-service-broker
@aliok
Copy link

aliok commented Jun 11, 2018

oc scale dc/asb --replicas=0 && oc scale dc/asb --replicas=1
should be

oc scale dc/asb -n ansible-service-broker --replicas=0 && oc scale dc/asb -n ansible-service-broker --replicas=1

@david-martin
Copy link
Author

thanks @aliok, updated

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