Over the last weeks I have been using a script which installs all the official xPaaS templates and ImageStreams etc. into a new cluster. Today I have decided to try to write a plugin for this and it seems to work (as I am NOT a bash script guru). This is the script, i call it install-imagestreams:
#!/bin/bash
function install-imagestreams.describe {
echo "This plugin installs all the Red Hat ImageStreams and possible templates you need to do your work"
install-imagestreams.help
}
function install-imagestreams.help {
:
}
function install-imagestreams.install {
status &> /dev/null || error_exit "There's no cluster running"
echo "Installing plugin"
# init jboss-image streams
oc create -n openshift -f https://raw.githubusercontent.com/jboss-openshift/application-templates/master/jboss-image-streams.json --as=system:admin
# init s2i java image streams
oc create -n openshift -f https://raw.githubusercontent.com/jorgemoralespou/s2i-java/master/ose3/s2i-java-imagestream.json --as=system:admin
# install all the xPaaS templates
git clone https://github.com/jboss-openshift/application-templates.git /tmp/app-templates
for i in /tmp/app-templates/amq/*.json; do oc create -f $i -n openshift --as=system:admin; done
for i in /tmp/app-templates/datagrid/*.json; do oc create -f $i -n openshift --as=system:admin; done
for i in /tmp/app-templates/datavirt/*.json; do oc create -f $i -n openshift --as=system:admin; done
for i in /tmp/app-templates/decisionserver/*.json; do oc create -f $i -n openshift --as=system:admin; done
for i in /tmp/app-templates/eap/*.json; do oc create -f $i -n openshift --as=system:admin; done
for i in /tmp/app-templates/processserver/*.json; do oc create -f $i -n openshift --as=system:admin; done
for i in /tmp/app-templates/sso/*.json; do oc create -f $i -n openshift --as=system:admin; done
for i in /tmp/app-templates/webserver/*.json; do oc create -f $i -n openshift --as=system:admin; done
rm -rf /tmp/app-templates
# install FIS 2.0 image streams
oc create -n openshift -f https://raw.githubusercontent.com/jboss-fuse/application-templates/application-templates-2.0.redhat-000026/fis-image-streams.json --as=system:admin
# install application templates for fuse
git clone https://github.com/jboss-fuse/application-templates.git /tmp/fuse-app-templates
for i in /tmp/fuse-app-templates/quickstarts/*.json; do oc create -f $i -n openshift --as=system:admin; done
rm -rf /tmp/fuse-app-templates
}
function install-imagestreams.uninstall {
echo "Unistalling plugin"
}
install-imagestreams.describe
@wpernath Look into #47 as @wkulhanek has done a PR for similar thing, with different Imagestreams. Will be happy to make this plugin or merge if it provides what you both want in the best way.
Over the last weeks I have been using a script which installs all the official xPaaS templates and ImageStreams etc. into a new cluster. Today I have decided to try to write a plugin for this and it seems to work (as I am NOT a bash script guru). This is the script, i call it install-imagestreams: