From 3dae550e301485d82446ad711bee769d93f64b49 Mon Sep 17 00:00:00 2001 From: Wade Barnes Date: Thu, 12 Jul 2018 10:36:46 -0700 Subject: [PATCH] EDIVORCE-50 - Add s21-nginx build to the build configurations. --- openshift/README.md | 18 ---- openshift/s2i-nginx-build.param | 10 +++ openshift/settings.sh | 2 +- .../nginx-proxy/s2i-nginx-build.json | 89 +++++++++++++++++++ 4 files changed, 100 insertions(+), 19 deletions(-) create mode 100644 openshift/s2i-nginx-build.param create mode 100644 openshift/templates/nginx-proxy/s2i-nginx-build.json diff --git a/openshift/README.md b/openshift/README.md index 2fff7d4f..4186fdfd 100644 --- a/openshift/README.md +++ b/openshift/README.md @@ -83,24 +83,6 @@ This allows you to do things like redirect your builds to use a different reposi To apply local settings while deploying your build and deployment configurations use the `-l` option with `genBuilds.sh` and `genDepls.sh`. -## 0. Build and publish the S2I image: - -*TODO: Add this process to the build configurations...* - -```docker build -t s2i-nginx git://github.com/BCDevOps/s2i-nginx``` - -### Tag and push this image to the OpenShift Docker Registry for your OpenShift Project: - -``` -docker tag s2i-nginx docker-registry.pathfinder.gov.bc.ca/jag-csb-edivorce-tools/s2i-nginx - -docker login docker-registry.pathfinder.gov.bc.ca -u -p - -docker push docker-registry.pathfinder.gov.bc.ca/jag-csb-edivorce-tools/s2i-nginx -``` - -(your docker token is the same as your OpenShift login token) - ## 1. Change into the top level openshift folder ``` cd //openshift diff --git a/openshift/s2i-nginx-build.param b/openshift/s2i-nginx-build.param new file mode 100644 index 00000000..afee937e --- /dev/null +++ b/openshift/s2i-nginx-build.param @@ -0,0 +1,10 @@ +#========================================================= +# OpenShift template parameters for: +# Component: . +# Template File: templates/nginx-proxy/s2i-nginx-build.json +#========================================================= +NAME=s2i-nginx +GIT_REPO_URL=https://github.com/BCDevOps/s2i-nginx.git +GIT_REF=master +SOURCE_CONTEXT_DIR= +OUTPUT_IMAGE_TAG=latest diff --git a/openshift/settings.sh b/openshift/settings.sh index 19c6ec24..27a027a4 100644 --- a/openshift/settings.sh +++ b/openshift/settings.sh @@ -9,7 +9,7 @@ export components="." # The templates that should not have their GIT referances(uri and ref) over-ridden # Templates NOT in this list will have they GIT referances over-ridden # with the values of GIT_URI and GIT_REF -export -a skip_git_overrides="schema-spy-build.json" +export -a skip_git_overrides="schema-spy-build.json s2i-nginx-build.json" # The templates that should not have their GIT referances(uri and ref) over-ridden # Templates NOT in this list will have they GIT referances over-ridden with the values of GIT_URI and GIT_REF diff --git a/openshift/templates/nginx-proxy/s2i-nginx-build.json b/openshift/templates/nginx-proxy/s2i-nginx-build.json new file mode 100644 index 00000000..1c9a2cf9 --- /dev/null +++ b/openshift/templates/nginx-proxy/s2i-nginx-build.json @@ -0,0 +1,89 @@ +{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "${NAME}-build-template", + "creationTimestamp": null + }, + "objects": [ + { + "apiVersion": "v1", + "kind": "ImageStream", + "metadata": { + "name": "${NAME}" + } + }, + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "${NAME}", + "labels": { + "app": "${NAME}" + } + }, + "spec": { + "triggers": [ + { + "type": "ConfigChange" + } + ], + "runPolicy": "Serial", + "source": { + "type": "Git", + "git": { + "uri": "${GIT_REPO_URL}", + "ref": "${GIT_REF}" + }, + "contextDir": "${SOURCE_CONTEXT_DIR}" + }, + "strategy": { + "type": "Docker" + }, + "output": { + "to": { + "kind": "ImageStreamTag", + "name": "${NAME}:${OUTPUT_IMAGE_TAG}" + } + } + } + } + ], + "parameters": [ + { + "name": "NAME", + "displayName": "Name", + "description": "The name assigned to all of the resources defined in this template.", + "required": true, + "value": "s2i-nginx" + }, + { + "name": "GIT_REPO_URL", + "displayName": "Git Repo URL", + "description": "The URL to your GIT repo, don't use the default unless your just experimenting.", + "required": true, + "value": "https://github.com/BCDevOps/s2i-nginx.git" + }, + { + "name": "GIT_REF", + "displayName": "Git Reference", + "description": "The git reference or branch.", + "required": true, + "value": "master" + }, + { + "name": "SOURCE_CONTEXT_DIR", + "displayName": "Source Context Directory", + "description": "The source context directory.", + "required": false, + "value": "" + }, + { + "name": "OUTPUT_IMAGE_TAG", + "displayName": "Output Image Tag", + "description": "The tag given to the built image.", + "required": true, + "value": "latest" + } + ] +} \ No newline at end of file