From 8f9bb721db23b3ce3a47c254c14311715259b557 Mon Sep 17 00:00:00 2001 From: Angelika Ehlers Date: Fri, 29 Jun 2018 14:54:13 -0700 Subject: [PATCH 01/10] Update search.html Fix search issue. Known issue with lib used. See https://github.com/sirlantis/liquid-node/issues/57. --- search.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/search.html b/search.html index e8c0fc7..61ba6c9 100644 --- a/search.html +++ b/search.html @@ -28,9 +28,9 @@ "url": "{{ page.url | xml_escape }}" } - {% unless forloop.last %} + // {% unless forloop.last %} , - {% endunless %} + // {% endunless %} {% endfor %} {% endfor %} From 5a83636e37483587da9643a90e0ea2425d1c1ecd Mon Sep 17 00:00:00 2001 From: Angelika Ehlers Date: Fri, 29 Jun 2018 15:02:09 -0700 Subject: [PATCH 02/10] Update search.html Fix syntax issue (comments) --- search.html | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/search.html b/search.html index 61ba6c9..ab30762 100644 --- a/search.html +++ b/search.html @@ -26,11 +26,7 @@ "content": {{ page.content | strip_html | strip_newlines | lstrip | jsonify }}, "description": "{{ page.description | xml_escape }}", "url": "{{ page.url | xml_escape }}" - } - - // {% unless forloop.last %} - , - // {% endunless %} + }, {% endfor %} {% endfor %} From 623396ea8c15d1d6076c14e1cae5826868aa376f Mon Sep 17 00:00:00 2001 From: Angelika Ehlers Date: Fri, 29 Jun 2018 15:17:01 -0700 Subject: [PATCH 03/10] Update Gemfile --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 1f161c3..257deac 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ source "https://rubygems.org" # # This will help ensure the proper Jekyll version is running. # Happy Jekylling! -gem "jekyll", "~> 3.7.2" +gem "jekyll", "3.7.2" # If you want to use GitHub Pages, remove the "gem "jekyll"" above and # uncomment the line below. To upgrade, run `bundle update github-pages`. From 58f8e71816f01c26cf946bd9e2d25f8d89145625 Mon Sep 17 00:00:00 2001 From: Angelika Ehlers Date: Fri, 29 Jun 2018 15:42:42 -0700 Subject: [PATCH 04/10] Update Gemfile --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 257deac..10f508a 100644 --- a/Gemfile +++ b/Gemfile @@ -8,7 +8,7 @@ source "https://rubygems.org" # # This will help ensure the proper Jekyll version is running. # Happy Jekylling! -gem "jekyll", "3.7.2" +gem "jekyll", "3.7.3" # If you want to use GitHub Pages, remove the "gem "jekyll"" above and # uncomment the line below. To upgrade, run `bundle update github-pages`. From 18be60a92faf57aa2e1ed332c9ffcf5e8ef6d651 Mon Sep 17 00:00:00 2001 From: ShellyXueHan Date: Wed, 25 Jul 2018 15:07:08 -0700 Subject: [PATCH 05/10] pipeline config --- .../templates/digital-toolkit-build.json | 40 +---- .../digital-toolkit-caddy-build.json | 6 +- .../digital-toolkit-deploy-prod.json | 142 ++++++++++++++++++ .../templates/digital-toolkit-deploy.json | 48 +++--- .../templates/digital-toolkit-route.json | 8 +- openshift/templates/pipeline-build.json | 46 ++++++ 6 files changed, 228 insertions(+), 62 deletions(-) create mode 100644 openshift/templates/digital-toolkit-deploy-prod.json create mode 100644 openshift/templates/pipeline-build.json diff --git a/openshift/templates/digital-toolkit-build.json b/openshift/templates/digital-toolkit-build.json index 01b28a8..d673ebf 100644 --- a/openshift/templates/digital-toolkit-build.json +++ b/openshift/templates/digital-toolkit-build.json @@ -5,18 +5,15 @@ "name": "innovation-toolkit", "creationTimestamp": null }, - "labels": { - "template":"toolkit-jekyll" - }, "objects": [ { "kind": "BuildConfig", "apiVersion": "v1", "metadata": { - "name": "${NAME}-jekyll${NAME_SUFFIX}", + "name": "innovation-toolkit", "creationTimestamp": null, "labels": { - "app": "${APP_NAME}" + "app": "innovation-toolkit" }, "annotations": { "openshift.io/generated-by": "OpenShiftNewApp" @@ -57,14 +54,14 @@ "dockerStrategy": { "from": { "kind": "ImageStreamTag", - "name": "ruby:2.3.0-alpine" + "name": "docker-registry.default.svc:5000/ocio-guides-tools/ruby:2.3.0-alpine" } } }, "output": { "to": { "kind": "ImageStreamTag", - "name": "${NAME}-jekyll${NAME_SUFFIX}:latest" + "name": "innovation-toolkit-jekyll:latest" } }, "resources": { @@ -88,11 +85,11 @@ "kind": "ImageStream", "apiVersion": "v1", "metadata": { - "name": "${NAME}", + "name": "innovation-toolkit-jekyll", "generation": 1, "creationTimestamp": null, "labels": { - "app": "${APP_NAME}" + "app": "innovation-toolkit" }, "annotations": { "openshift.io/generated-by": "OpenShiftNewApp" @@ -108,7 +105,7 @@ "annotations": null, "from": { "kind": "DockerImage", - "name": "172.50.0.2:5000/guides/innovation-toolkit:latest" + "name": "172.50.0.2:5000/ocio-guides-tools/innovation-toolkit-jekyll:latest" }, "generation": null, "importPolicy": {}, @@ -122,26 +119,5 @@ "dockerImageRepository": "" } } - ], - "parameters": [ - { - "name": "APP_NAME", - "displayName": "Name", - "description": "Application name used for grouping objects in the openshift console. You should keep this as default unless your know what your doing.", - "required": true, - "value": "innovation-toolkit" - },{ - "name": "NAME", - "displayName": "Name", - "description": "The name assigned to all of the objects defined in this template. You should keep this as default unless your know what your doing.", - "required": true, - "value": "innovation-toolkit" - },{ - "name": "NAME_SUFFIX", - "displayName": "Name", - "description": "The suffix for all created objects", - "required": false, - "value": "" - } ] -} +} \ No newline at end of file diff --git a/openshift/templates/digital-toolkit-caddy-build.json b/openshift/templates/digital-toolkit-caddy-build.json index cf97836..e8a1c73 100644 --- a/openshift/templates/digital-toolkit-caddy-build.json +++ b/openshift/templates/digital-toolkit-caddy-build.json @@ -47,16 +47,16 @@ "runPolicy": "Serial", "source": { "type": "Dockerfile", - "dockerfile": "FROM bcgov-s2i-caddy\nCOPY _site /var/www/html/", + "dockerfile": "FROM bcgov-s2i-caddy\nCOPY /toolkit/_site /var/www/html/", "images": [ { "from": { "kind": "ImageStreamTag", - "name": "${NAME}-jekyll${NAME_SUFFIX}:latest" + "name": "innovation-toolkit-jekyll:latest" }, "paths": [ { - "sourcePath": "/opt/app-root/src/_site", + "sourcePath": "/toolkit", "destinationDir": "./" } ] diff --git a/openshift/templates/digital-toolkit-deploy-prod.json b/openshift/templates/digital-toolkit-deploy-prod.json new file mode 100644 index 0000000..e8ef25d --- /dev/null +++ b/openshift/templates/digital-toolkit-deploy-prod.json @@ -0,0 +1,142 @@ +{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "innovation-toolkit-caddy", + "creationTimestamp": null + }, + "objects": [ + { + "kind": "DeploymentConfig", + "apiVersion": "v1", + "metadata": { + "name": "innovation-toolkit-caddy", + "generation": 1, + "creationTimestamp": null, + "labels": { + "app": "innovation-toolkit-caddy" + }, + "annotations": { + "openshift.io/generated-by": "OpenShiftWebConsole" + } + }, + "spec": { + "strategy": { + "type": "Rolling", + "rollingParams": { + "updatePeriodSeconds": 1, + "intervalSeconds": 1, + "timeoutSeconds": 600, + "maxUnavailable": "25%", + "maxSurge": "25%" + }, + "resources": {}, + "activeDeadlineSeconds": 21600 + }, + "triggers": [ + { + "type": "ConfigChange" + }, + { + "type": "ImageChange", + "imageChangeParams": { + "automatic": true, + "containerNames": [ + "innovation-toolkit-caddy" + ], + "from": { + "kind": "ImageStreamTag", + "namespace": "ocio-guides-tools", + "name": "innovation-toolkit-caddy:prod" + } + } + } + ], + "replicas": 1, + "test": false, + "selector": { + "app": "innovation-toolkit-caddy", + "deploymentconfig": "innovation-toolkit-caddy" + }, + "template": { + "metadata": { + "creationTimestamp": null, + "labels": { + "app": "innovation-toolkit-caddy", + "deploymentconfig": "innovation-toolkit-caddy" + }, + "annotations": { + "openshift.io/generated-by": "OpenShiftWebConsole" + } + }, + "spec": { + "containers": [ + { + "name": "innovation-toolkit-caddy", + "image": "docker-registry.default.svc:5000/ocio-guides-tools/innovation-toolkit-caddy@sha256:b3cbedf2a2f40521a1dc94280f67a5d68635ce095f03f0b587b48b410919842b", + "args": [ + "/tmp/scripts/run" + ], + "ports": [ + { + "containerPort": 2015, + "protocol": "TCP" + } + ], + "resources": {}, + "terminationMessagePath": "/dev/termination-log", + "terminationMessagePolicy": "File", + "imagePullPolicy": "Always" + } + ], + "restartPolicy": "Always", + "terminationGracePeriodSeconds": 30, + "dnsPolicy": "ClusterFirst", + "securityContext": {}, + "schedulerName": "default-scheduler" + } + } + }, + "status": { + "latestVersion": 0, + "observedGeneration": 0, + "replicas": 0, + "updatedReplicas": 0, + "availableReplicas": 0, + "unavailableReplicas": 0 + } + }, + { + "kind": "Service", + "apiVersion": "v1", + "metadata": { + "name": "innovation-toolkit-caddy", + "creationTimestamp": null, + "labels": { + "app": "innovation-toolkit-caddy" + }, + "annotations": { + "openshift.io/generated-by": "OpenShiftWebConsole" + } + }, + "spec": { + "ports": [ + { + "name": "2015-tcp", + "protocol": "TCP", + "port": 2015, + "targetPort": 2015 + } + ], + "selector": { + "deploymentconfig": "innovation-toolkit-caddy" + }, + "type": "ClusterIP", + "sessionAffinity": "None" + }, + "status": { + "loadBalancer": {} + } + } + ] +} diff --git a/openshift/templates/digital-toolkit-deploy.json b/openshift/templates/digital-toolkit-deploy.json index e7ce507..eb9df44 100644 --- a/openshift/templates/digital-toolkit-deploy.json +++ b/openshift/templates/digital-toolkit-deploy.json @@ -2,7 +2,7 @@ "kind": "Template", "apiVersion": "v1", "metadata": { - "name": "innovation-toolkit", + "name": "innovation-toolkit-caddy", "creationTimestamp": null }, "objects": [ @@ -10,14 +10,14 @@ "kind": "DeploymentConfig", "apiVersion": "v1", "metadata": { - "name": "innovation-toolkit", + "name": "innovation-toolkit-caddy", "generation": 1, "creationTimestamp": null, "labels": { - "app": "innovation-toolkit" + "app": "innovation-toolkit-caddy" }, "annotations": { - "openshift.io/generated-by": "OpenShiftNewApp" + "openshift.io/generated-by": "OpenShiftWebConsole" } }, "spec": { @@ -42,12 +42,12 @@ "imageChangeParams": { "automatic": true, "containerNames": [ - "innovation-toolkit" + "innovation-toolkit-caddy" ], "from": { "kind": "ImageStreamTag", - "namespace": "guides", - "name": "innovation-toolkit:latest" + "namespace": "ocio-guides-tools", + "name": "innovation-toolkit-caddy:latest" } } } @@ -55,28 +55,31 @@ "replicas": 1, "test": false, "selector": { - "app": "innovation-toolkit", - "deploymentconfig": "innovation-toolkit" + "app": "innovation-toolkit-caddy", + "deploymentconfig": "innovation-toolkit-caddy" }, "template": { "metadata": { "creationTimestamp": null, "labels": { - "app": "innovation-toolkit", - "deploymentconfig": "innovation-toolkit" + "app": "innovation-toolkit-caddy", + "deploymentconfig": "innovation-toolkit-caddy" }, "annotations": { - "openshift.io/generated-by": "OpenShiftNewApp" + "openshift.io/generated-by": "OpenShiftWebConsole" } }, "spec": { "containers": [ { - "name": "innovation-toolkit", - "image": "172.50.0.2:5000/guides/innovation-toolkit@sha256:e2da593f8d590abd8e4e94217aa189815960e46e64891f306b87574e6be8c56c", + "name": "innovation-toolkit-caddy", + "image": "docker-registry.default.svc:5000/ocio-guides-tools/innovation-toolkit-caddy@sha256:b3cbedf2a2f40521a1dc94280f67a5d68635ce095f03f0b587b48b410919842b", + "args": [ + "/tmp/scripts/run" + ], "ports": [ { - "containerPort": 4000, + "containerPort": 2015, "protocol": "TCP" } ], @@ -107,27 +110,26 @@ "kind": "Service", "apiVersion": "v1", "metadata": { - "name": "innovation-toolkit", + "name": "innovation-toolkit-caddy", "creationTimestamp": null, "labels": { - "app": "innovation-toolkit" + "app": "innovation-toolkit-caddy" }, "annotations": { - "openshift.io/generated-by": "OpenShiftNewApp" + "openshift.io/generated-by": "OpenShiftWebConsole" } }, "spec": { "ports": [ { - "name": "4000-tcp", + "name": "2015-tcp", "protocol": "TCP", - "port": 4000, - "targetPort": 4000 + "port": 2015, + "targetPort": 2015 } ], "selector": { - "app": "innovation-toolkit", - "deploymentconfig": "innovation-toolkit" + "deploymentconfig": "innovation-toolkit-caddy" }, "type": "ClusterIP", "sessionAffinity": "None" diff --git a/openshift/templates/digital-toolkit-route.json b/openshift/templates/digital-toolkit-route.json index 543048a..9a77bbd 100644 --- a/openshift/templates/digital-toolkit-route.json +++ b/openshift/templates/digital-toolkit-route.json @@ -21,14 +21,14 @@ } }, "spec": { - "host": "digital-toolkit.pathfinder.gov.bc.ca", + "host": "digital-toolkit-dev.pathfinder.gov.bc.ca", "to": { "kind": "Service", - "name": "innovation-toolkit", + "name": "innovation-toolkit-caddy", "weight": 100 }, "port": { - "targetPort": "4000-tcp" + "targetPort": "2015-tcp" }, "tls": { "termination": "edge", @@ -39,7 +39,7 @@ "status": { "ingress": [ { - "host": "digital-toolkit.pathfinder.gov.bc.ca", + "host": "digital-toolkit-dev.pathfinder.gov.bc.ca", "routerName": "router", "conditions": [ { diff --git a/openshift/templates/pipeline-build.json b/openshift/templates/pipeline-build.json new file mode 100644 index 0000000..6cf25b4 --- /dev/null +++ b/openshift/templates/pipeline-build.json @@ -0,0 +1,46 @@ +{ + "kind": "Template", + "apiVersion": "v1", + "metadata": { + "name": "innovation-toolkit", + "creationTimestamp": null + }, + "objects": [ + { + "kind": "BuildConfig", + "apiVersion": "v1", + "metadata": { + "name": "innovation-toolkit-pipeline", + "creationTimestamp": null, + "labels": { + "app": "innovation-toolkit-pipeline", + "name": "innovation-toolkit-pipeline", + "template": "innovation-toolkit-pipeline" + } + }, + "spec": { + "runPolicy": "Parallel", + "source": { + "type": "Git", + "git": { + "uri": "https://github.com/bcgov/digital-toolkit.git", + "ref": "develop" + } + }, + "strategy": { + "type": "JenkinsPipeline", + "jenkinsPipelineStrategy": { + "jenkinsfilePath": "Jenkinsfile" + } + }, + "output": {}, + "resources": {}, + "postCommit": {}, + "nodeSelector": null + }, + "status": { + "lastVersion": 0 + } + } + ] +} \ No newline at end of file From b431c13595c7a5651d479749e7edb441f2367f9a Mon Sep 17 00:00:00 2001 From: ShellyXueHan Date: Wed, 25 Jul 2018 15:31:55 -0700 Subject: [PATCH 06/10] update Jenkins build stage --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index bd78a35..597d64f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ node('master') { // run the oc build to package the artifacts into a docker image openshiftBuild bldCfg: APP_NAME, showBuildLogs: 'true', verbose: 'true' - // openshiftBuild bldCfg: CADDY_BUILD_CONFIG, showBuildLogs: 'true', verbose: 'true' + openshiftBuild bldCfg: CADDY_BUILD_CONFIG, showBuildLogs: 'true', verbose: 'true' // Don't tag with BUILD_ID so the pruner can do it's job; it won't delete tagged images. // Tag the images for deployment based on the image's hash From 89092259ef2c082c3ef743d567baee5891a24c3a Mon Sep 17 00:00:00 2001 From: ShellyXueHan Date: Wed, 25 Jul 2018 15:32:08 -0700 Subject: [PATCH 07/10] remove unused s2i folder --- .s2i/bin/assemble | 43 ------------------------------------------- .s2i/bin/run | 11 ----------- 2 files changed, 54 deletions(-) delete mode 100644 .s2i/bin/assemble delete mode 100644 .s2i/bin/run diff --git a/.s2i/bin/assemble b/.s2i/bin/assemble deleted file mode 100644 index d8945bb..0000000 --- a/.s2i/bin/assemble +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -e -# -# S2I assemble script for the 's2i-caddy' image. -# The 'assemble' script builds your application source so that it is ready to run. -# -# For more information refer to the documentation: -# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md -# - -if [[ "$1" == "-h" ]]; then - # If the 's2i-caddy' assemble script is executed with '-h' flag, - # print the usage. - exec /usr/libexec/s2i/usage -fi - -# Restore artifacts from the previous build (if they exist). -# -if [ "$(ls /tmp/artifacts/ 2>/dev/null)" ]; then - echo "---> Restoring build artifacts..." - mv /tmp/artifacts/. ./ -fi - -echo "---> Copying repository content into place..." -echo "Contents of /tmp/src:" -find /tmp/src -print -cp -Rf /tmp/src/* /var/www/html - -# (through detective work, we discovered that additional source image content is placed in /tmp/build/inputs by s2i) -# the bit below allows additional content that originates from one or more additional source images to be added to the output image -if [ -d /tmp/build/inputs ]; then - echo "Additional image content found..." - echo "---> Copying additional image content into place..." - cp -Rf /tmp/build/inputs/* /var/www/html -else - echo "No additional image content found." -fi - -if [[ -e "/var/www/html/Caddyfile" ]]; then - echo "Replacing default Caddyfile..." - cat /var/www/html/Caddyfile > /etc/Caddyfile -else - echo "Using default Caddyfile." -fi \ No newline at end of file diff --git a/.s2i/bin/run b/.s2i/bin/run deleted file mode 100644 index fb70c05..0000000 --- a/.s2i/bin/run +++ /dev/null @@ -1,11 +0,0 @@ - -#!/bin/sh -e -# -# S2I run script for the 's2i-caddy' image. -# The run script executes the server that runs your application. -# -# For more information see the documentation: -# https://github.com/openshift/source-to-image/blob/master/docs/builder_image.md -# - -exec caddy -quic --conf /etc/Caddyfile \ No newline at end of file From abf3d4a5d1414b64f5df10b546cd5e722981ead5 Mon Sep 17 00:00:00 2001 From: ShellyXueHan Date: Wed, 25 Jul 2018 15:36:40 -0700 Subject: [PATCH 08/10] update the github trigger branch to os-pages according to readme --- openshift/templates/digital-toolkit-build.json | 2 +- openshift/templates/pipeline-build.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openshift/templates/digital-toolkit-build.json b/openshift/templates/digital-toolkit-build.json index d673ebf..2f0b5ce 100644 --- a/openshift/templates/digital-toolkit-build.json +++ b/openshift/templates/digital-toolkit-build.json @@ -46,7 +46,7 @@ "type": "Git", "git": { "uri": "https://github.com/bcgov/digital-toolkit.git", - "ref": "develop" + "ref": "os-pages" } }, "strategy": { diff --git a/openshift/templates/pipeline-build.json b/openshift/templates/pipeline-build.json index 6cf25b4..0e2439e 100644 --- a/openshift/templates/pipeline-build.json +++ b/openshift/templates/pipeline-build.json @@ -24,7 +24,7 @@ "type": "Git", "git": { "uri": "https://github.com/bcgov/digital-toolkit.git", - "ref": "develop" + "ref": "os-pages" } }, "strategy": { From 782b0c95d0dc711b429275b3b14194ec4b92542b Mon Sep 17 00:00:00 2001 From: ShellyXueHan <36056216+ShellyXueHan@users.noreply.github.com> Date: Wed, 25 Jul 2018 15:49:32 -0700 Subject: [PATCH 09/10] Update README.md --- openshift/templates/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openshift/templates/README.md b/openshift/templates/README.md index 571bea0..c40ca58 100644 --- a/openshift/templates/README.md +++ b/openshift/templates/README.md @@ -1,6 +1,6 @@ ## Deployment Flow: -Update in the `develop` branch will trigger Jenkins pipeline: +Update in the `os-pages` branch will trigger Jenkins pipeline: 1. Checkout the source from Github 2. Build images: From 7b42cb543d763e8192e637a70d0bfdbdd22c9f69 Mon Sep 17 00:00:00 2001 From: Jim Rabb Date: Wed, 8 Aug 2018 11:03:28 -0700 Subject: [PATCH 10/10] Update aged-out.md elipsis --- _in-practice-examples/aged-out.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_in-practice-examples/aged-out.md b/_in-practice-examples/aged-out.md index fc4983d..dc6f1eb 100644 --- a/_in-practice-examples/aged-out.md +++ b/_in-practice-examples/aged-out.md @@ -7,7 +7,7 @@ example-of: Put your user and their needs at the centre of your design ### Impact -Agedout.com uses modern, interactive technology to guide users through “Quests.” As the youth proceed through the quests, they earn badges for their learning. Youth are then able to put the badges towards real life rewards, such as computers from Best Buy. \[Metrics forthcoming.\] This approach has the potential to expand to other Ministries, the Quests functionality and methodology being shared with partners in an example of gov-as-a-platform. +Agedout.com uses modern, interactive technology to guide users through “Quests.” As the youth proceed through the quests, they earn badges for their learning. Youth are then able to put the badges towards real life rewards, such as computers from Best Buy. \[Metrics forthcoming.\] This approach has the potential to expand to other Ministries, the Quests functionality and methodology being shared with partners in an example of gov-as-a-platform... ### Partners