From 759c1f5000baf965e94f8aee763ea74e1b70f127 Mon Sep 17 00:00:00 2001 From: Robert Greathouse Date: Thu, 2 May 2019 08:49:10 -0700 Subject: [PATCH] Initial development of a Keycloak addon Installs a Keycloak instance based on the official Keycloak template at https://raw.githubusercontent.com/jboss-dockerfiles/keycloak/master/openshift-examples/keycloak-https.json --- add-ons/keycloak/keycloak.addon | 23 +++++++++++++++++++++++ add-ons/keycloak/keycloak.addon.remove | 14 ++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 add-ons/keycloak/keycloak.addon create mode 100644 add-ons/keycloak/keycloak.addon.remove diff --git a/add-ons/keycloak/keycloak.addon b/add-ons/keycloak/keycloak.addon new file mode 100644 index 0000000..25e753f --- /dev/null +++ b/add-ons/keycloak/keycloak.addon @@ -0,0 +1,23 @@ +################################################################################################### +# Name: keycloak +# Description: Installs Keycloak in a Keycloak project +# Required-Vars: OPENSHIFT_USERNAME, OPENSHIFT_PASSWORD, KEYCLOAK_PROJECT, KEYCLOAK_USER, KEYCLOAK_PASSWORD,DB_VENDOR +# OpenShift-Version: >=3.9.0 +# Var-Defaults: OPENSHIFT_USERNAME=developer,OPENSHIFT_PASSWORD=developer,KEYCLOAK_PROJECT=keycloak,KEYCLOAK_USER=admin,KEYCLOAK_PASSWORD=admin,DB_VENDOR=h2 +# Url: Template from https://raw.githubusercontent.com/jboss-dockerfiles/keycloak/master/openshift-examples/keycloak-https.json +################################################################################################### + +# login +oc login -u system:admin + +# add template +oc create -n openshift -f https://raw.githubusercontent.com/jboss-dockerfiles/keycloak/master/openshift-examples/keycloak-https.json + +# login +oc login -u #{OPENSHIFT_USERNAME} -p #{OPENSHIFT_PASSWORD} + +# create project +oc new-project #{KEYCLOAK_PROJECT} + +# instantiate keycloak +oc new-app keycloak-https -p APPLICATION_NAME=#{KEYCLOAK_PROJECT} -p NAMESPACE=#{KEYCLOAK_PROJECT} -p KEYCLOAK_USER=#{KEYCLOAK_USER} -p KEYCLOAK_PASSWORD=#{KEYCLOAK_PASSWORD} diff --git a/add-ons/keycloak/keycloak.addon.remove b/add-ons/keycloak/keycloak.addon.remove new file mode 100644 index 0000000..9398780 --- /dev/null +++ b/add-ons/keycloak/keycloak.addon.remove @@ -0,0 +1,14 @@ +################################################################################################### +# Name: keycloak +# Description: Installs Keycloak in a Keycloak project +# Required-Vars: OPENSHIFT_USERNAME, OPENSHIFT_PASSWORD, KEYCLOAK_PROJECT, KEYCLOAK_USER, KEYCLOAK_PASSWORD, +# OpenShift-Version: >=3.9.0 +# Var-Defaults: OPENSHIFT_USERNAME=developer,OPENSHIFT_PASSWORD=developer,KEYCLOAK_PROJECT=keycloak,DB_VENDOR=h2,KEYCLOAK_USER=admin,KEYCLOAK_PASSWORD=admin +# Url: Template from https://raw.githubusercontent.com/robert-greathouse/keycloak/master/openshift-examples/keycloak-https.json +################################################################################################### + +oc login -u system:admin + +oc delete template keycloak-https -n openshift + +oc delete project keycloak