hzgraham / patchapp

1 stars 1 forks source link

:toc: macro = AutoPatch

Patching tool to assist with exclude maintenance.

toc::[]

= Basic Setup

== Create a project Create a project to house the app:

[source, bash]

oc new-project

Install and launch the app from a template: (currently the LDAP_BASEDN needs separate the dc=.. by spaces not commas because causes problems with last command oc process)

[source, bash]

oc create -f https://raw.githubusercontent.com/hzgraham/patchapp/master/app_template.json export SATELLITE_HOST="satellite.example.com" export SATELLITE_USER="user" export SATELLITE_PASSWORD="password" export LDAP_HOST="ldap.example.com" export LDAP_CACERT_URL="http://server.example.com/ca.crt" export LDAP_BASEDN="dc=example dc=com" export LDAP_ADMIN_GROUP="admingroup" oc process -v="LDAP_CACERT_URL=${LDAP_CACERT_URL},LDAP_HOST=${LDAP_HOST},LDAP_BASEDN=${LDAP_BASEDN},LDAP_ADMIN_GROUP=${LDAP_ADMIN_GROUP},SATELLITE_HOST=${SATELLITE_HOST},SATELLITE_USER=${SATELLITE_USER},SATELLITE_PASSWORD=${SATELLITE_PASSWORD}" patchapp | oc create -f -

Then, check the results:

[source, bash]

oc get builds -w

= Builds

Docker image builds can be initiated by navigating to the "Builds" tab in the V3 web console. Click on the Start Build button for each service.

You can also initiate the builds from the command line:

[source, bash]

oc start-build patchapp

Watch the progress:

[source, bash]

oc get pods -w

= Routing

In order to view the patchapp, you'll need to expose your service by setting up a Route. The optional --hostname flag allows you to create a custom route to an existing service:

[source, bash]

oc expose svc/patchapp --hostname=

Make sure this route is addressable from wherever you are running your browser (an /etc/hosts entry in your client may be required).

Excluding the --hostname flag should generate a default route that automatically takes advantage of your cluster's wildcard DNS (if available):

[source, bash]

oc expose svc/patchapp

Now, try listing your existing routes:

[source, bash]

oc get route

= Local Development

== Pre-Requisutes

== Run patchapp locally

The 'run' Makefile target will install application dependencies within a python virtual environment and then run the application.

[source, bash]

make run

You can enable Django debugging by setting the following in the project/settings.py

DEBUG = True

Return DEBUG to False or do not push changes to production.