From 650966c355eacef5209d984b47a07d70a831908e Mon Sep 17 00:00:00 2001 From: Mike Olund Date: Sun, 19 Feb 2017 19:53:56 -0800 Subject: [PATCH] updated the build templates following git repository move and weasyprint fork --- .env.example | 10 ++++++++++ nginx-proxy/conf.d/server.conf | 20 +++++++++++++------ .../templates/edivorce-build-template.yaml | 2 +- .../edivorce-environment-template.yaml | 11 +++++----- openshift/templates/nginx-build-template.yaml | 2 +- 5 files changed, 32 insertions(+), 13 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 00000000..3b4b5ce2 --- /dev/null +++ b/.env.example @@ -0,0 +1,10 @@ +LOCAL_DEV=True +DEBUG=True +TEMPLATE_DEBUG=True +DJANGO_SECRET_KEY= +DATABASE_ENGINE=django.db.backends.sqlite3 +DATABASE_NAME=db.sqlite3 +DATABASE_USER= +DATABASE_PASSWORD= +DATABASE_HOST= +DATABASE_PORT= diff --git a/nginx-proxy/conf.d/server.conf b/nginx-proxy/conf.d/server.conf index cc19a5df..a71e8cea 100644 --- a/nginx-proxy/conf.d/server.conf +++ b/nginx-proxy/conf.d/server.conf @@ -12,10 +12,15 @@ server { proxy_pass http://edivorce-django:8080; proxy_pass_request_headers on; - # rewrite 302 redirect responses - # proxy_redirect http://edivorce-django:8080 https://justice.gov.bc.ca; + # rewrite 302 redirect responses to absolute URL's so the justice proxy + # doesn't mangle them by adding double slashes to relative URL's + proxy_redirect http://edivorce-django:8080 https://justice.gov.bc.ca; - # remove directories from incoming requests + # remove directories from incoming requests; + rewrite ^/divorce-dev$ / last; + rewrite ^/divorce-test$ / last; + rewrite ^/divorce$ / last; + rewrite ^/divorce-dev(.*)$ $1 last; rewrite ^/divorce-test(.*)$ $1 last; rewrite ^/divorce(.*)$ $1 last; @@ -27,20 +32,23 @@ server { rewrite ^(.*)//(.*)$ $1/$2; } - # static rewrite (dev) + # static no rewrite (dev) location /divorce-dev/static/ { + #todo: add caching proxy_pass http://edivorce-django:8080; proxy_pass_request_headers on; } - # static rewrite (test) + # static no rewrite (test) location /divorce-test/static/ { + #todo: add caching proxy_pass http://edivorce-django:8080; proxy_pass_request_headers on; } - # static rewrite (prod) + # static no rewrite (prod) location /divorce/static/ { + #todo: add caching proxy_pass http://edivorce-django:8080; proxy_pass_request_headers on; } diff --git a/openshift/templates/edivorce-build-template.yaml b/openshift/templates/edivorce-build-template.yaml index 9ffc95c4..5a1cae43 100644 --- a/openshift/templates/edivorce-build-template.yaml +++ b/openshift/templates/edivorce-build-template.yaml @@ -66,7 +66,7 @@ parameters: displayName: Git Repository URL required: true description: The URL of the repository with your application source code. - value: https://github.com/bcgov/eDivorce.git + value: https://github.com/bcgov/eDivorce - name: SOURCE_REPOSITORY_REF displayName: Git Reference description: Set this to a branch name, tag or other ref of your repository if you are not using the default branch. diff --git a/openshift/templates/edivorce-environment-template.yaml b/openshift/templates/edivorce-environment-template.yaml index 080a6851..d880e94b 100644 --- a/openshift/templates/edivorce-environment-template.yaml +++ b/openshift/templates/edivorce-environment-template.yaml @@ -187,10 +187,10 @@ objects: tags: - name: latest annotations: - openshift.io/imported-from: aquavitae/weasyprint + openshift.io/imported-from: jag-csb-edivorce-tools/weasyprint from: kind: DockerImage - name: aquavitae/weasyprint + name: jag-csb-edivorce-tools/weasyprint - kind: Service apiVersion: v1 metadata: @@ -216,7 +216,7 @@ objects: spec: strategy: type: Recreate - triggers: + triggers: - type: ImageChange imageChangeParams: automatic: true @@ -224,7 +224,8 @@ objects: - weasyprint from: kind: ImageStreamTag - name: 'aquavitae/weasyprint:latest' + namespace: jag-csb-edivorce-tools + name: 'weasyprint:latest' replicas: 1 selector: name: weasyprint @@ -238,7 +239,7 @@ objects: spec: containers: - name: weasyprint - image: 'aquavitae/weasyprint' + image: 'jag-csb-edivorce-tools/weasyprint' ports: - containerPort: 5001 protocol: TCP diff --git a/openshift/templates/nginx-build-template.yaml b/openshift/templates/nginx-build-template.yaml index 342e0f37..ed43dc98 100644 --- a/openshift/templates/nginx-build-template.yaml +++ b/openshift/templates/nginx-build-template.yaml @@ -64,7 +64,7 @@ parameters: - name: SOURCE_REPOSITORY_URL displayName: Git Repository URL description: The URL of the repository with your nginx configuration code. - value: https://github.com/molund/eDivorce + value: https://github.com/bcgov/eDivorce required: true - name: SOURCE_REPOSITORY_CONTEXT_DIR displayName: Git sub-directory