= s2i devonfw

This are the s2i source and templates to build an s2i images. It provides OpenShift builder images for components of the devonfw (at this moment only for angular and java).

This work is totally based on the implementation of  https://github.com/Mickuehl[Michael Kuehl] from RedHat for Oasp s2i.

All this information is used as a part of the link:dsf-okd-initial-setup[initial setup] for openshift.

== Previous setup

In order to build all of this, it will be necessary, first, to have a running OpenShift cluster. How to install it link:dsf-okd-how-to-install[here].

== Usage

Before using the builder images, add them to the OpenShift cluster.

=== Deploy the Source-2-Image builder images

First, create a dedicated `devonfw` project as admin.

[source,Shell]
----
$ oc new-project devonfw --display-name='devonfw' --description='devonfw Application Standard Platform'
----

Now add the builder image configuration and start their build.

[source,Shell]
----
oc create -f https://raw.githubusercontent.com/devonfw/devonfw-shop-floor/master/dsf4openshift/openshift-devonfw-deployment/s2i/java/s2i-devonfw-java-imagestream.json --namespace=devonfw
oc create -f https://raw.githubusercontent.com/devonfw/devonfw-shop-floor/master/dsf4openshift/openshift-devonfw-deployment/s2i/angular/s2i-devonfw-angular-imagestream.json --namespace=devonfw
oc start-build s2i-devonfw-java --namespace=devonfw
oc start-build s2i-devonfw-angular --namespace=devonfw
----
    
Make sure other projects can access the builder images:

[source,Shell]
----
oc policy add-role-to-group system:image-puller system:authenticated --namespace=devonfw
----

That's all!

=== Deploy devonfw templates

Now, it's time to create devonfw templates to use this s2i and add it to the browse catalog. More information link:dsf-okd-templates[here].

== Build All

Use https://raw.githubusercontent.com/devonfw/devonfw-shop-floor/master/dsf4openshift/openshift-cluster-setup/initial-setup/initial-setup.sh[this] script to automatically install and build all image streams. The script also creates templates devonfw-angular and devonfw-java inside the project 'openshift' to be used by everyone.

. Open a bash shell as Administrator
. Execute shell file: 

[source,Shell]
----
$ /PATH/TO/BUILD/FILE/initial-setup.sh
----

More information about what this script does https://raw.githubusercontent.com/devonfw/devonfw-shop-floor/master/dsf4openshift/openshift-cluster-setup/initial-setup#script-initial-setup[here].

== Links & References

This is a list of useful articles, etc, that I found while creating the templates.

* https://github.com/openshift/openshift-docs/issues/1329[Template Icons]
* https://github.com/jbossdemocentral/coolstore-microservice[Red Hat Cool Store Microservice Demo]
* https://docs.openshift.com/container-platform/4.9/web_console/customizing-the-web-console.html[Openshift Web Console Customization]