Openshift updatespull/160/head
| @ -0,0 +1,8 @@ | |||
| # Set the default behavior, in case people don't have core.autocrlf set. | |||
| * text=auto | |||
| # Declare files that will always have LF line endings on checkout. | |||
| manage text eol=lf | |||
| *.sh text eol=lf | |||
| *.md text eol=lf | |||
| *.json text eol=lf | |||
| @ -0,0 +1,29 @@ | |||
| // Edit your app's name below | |||
| def APP_NAME = 'edivorce-django' | |||
| // Edit your environment TAG names below | |||
| def TAG_NAMES = ['dev', 'test', 'prod'] | |||
| // You shouldn't have to edit these if you're following the conventions | |||
| def BUILD_CONFIG = APP_NAME | |||
| def IMAGESTREAM_NAME = APP_NAME | |||
| node { | |||
| properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10']]]) | |||
| stage('build ' + BUILD_CONFIG) { | |||
| echo "Building: " + BUILD_CONFIG | |||
| openshiftBuild bldCfg: BUILD_CONFIG, showBuildLogs: '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 | |||
| IMAGE_HASH = sh ( | |||
| script: """oc get istag ${IMAGESTREAM_NAME}:latest -o template --template=\"{{.image.dockerImageReference}}\"|awk -F \":\" \'{print \$3}\'""", | |||
| returnStdout: true).trim() | |||
| echo ">> IMAGE_HASH: ${IMAGE_HASH}" | |||
| } | |||
| stage('deploy-' + TAG_NAMES[0]) { | |||
| openshiftTag destStream: IMAGESTREAM_NAME, verbose: 'true', destTag: TAG_NAMES[0], srcStream: IMAGESTREAM_NAME, srcTag: "${IMAGE_HASH}" | |||
| } | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| #========================================================= | |||
| # OpenShift Jenkins pipeline template parameters for: | |||
| # Jenkinsfile: ./jenkins/build-and-deploy-to-dev-Jenkinsfile | |||
| # Template File: https://raw.githubusercontent.com/BCDevOps/openshift-tools/master/provisioning/pipeline/resources/pipeline-build.json | |||
| #========================================================= | |||
| NAME=build-and-deploy-to-dev | |||
| # GITHUB_WEBHOOK_SECRET=[a-zA-Z0-9]{40} | |||
| SOURCE_REPOSITORY_URL=https://github.com/bcgov/eDivorce.git | |||
| SOURCE_REPOSITORY_REF=master | |||
| CONTEXT_DIR=jenkins | |||
| JENKINSFILE_PATH=build-and-deploy-to-dev-Jenkinsfile | |||
| @ -0,0 +1,17 @@ | |||
| // This Jenkins file uses a brute force method to promote the application images from TEST to PROD. | |||
| // In other words all of the images that are currently deployed in TEST will be tagged for deployment to PROD. | |||
| // Define these in the order they should be deployed. | |||
| def APP_NAMES = ['postgresql', 'nginx-proxy', 'weasyprint', 'edivorce-django'] | |||
| def SOURCE_TAG = 'test' | |||
| def DESTINATION_TAG = 'prod' | |||
| node { | |||
| properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10']]]) | |||
| APP_NAMES.each { appName -> | |||
| stage('Deploying ' + appName + ' to ' + DESTINATION_TAG) { | |||
| openshiftTag destStream: appName, verbose: 'true', destTag: DESTINATION_TAG, srcStream: appName, srcTag: SOURCE_TAG | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| #========================================================= | |||
| # OpenShift Jenkins pipeline template parameters for: | |||
| # Jenkinsfile: ./jenkins/deploy-to-prod-Jenkinsfile | |||
| # Template File: https://raw.githubusercontent.com/BCDevOps/openshift-tools/master/provisioning/pipeline/resources/pipeline-build.json | |||
| #========================================================= | |||
| NAME=deploy-to-prod | |||
| # GITHUB_WEBHOOK_SECRET=[a-zA-Z0-9]{40} | |||
| SOURCE_REPOSITORY_URL=https://github.com/bcgov/eDivorce.git | |||
| SOURCE_REPOSITORY_REF=master | |||
| CONTEXT_DIR=jenkins | |||
| JENKINSFILE_PATH=deploy-to-prod-Jenkinsfile | |||
| @ -0,0 +1,17 @@ | |||
| // This Jenkins file uses a brute force method to promote the application images from DEV to TEST. | |||
| // In other words all of the images that are currently deployed in DEV will be tagged for deployment to TEST. | |||
| // Define these in the order they should be deployed. | |||
| def APP_NAMES = ['postgresql', 'nginx-proxy', 'weasyprint', 'edivorce-django'] | |||
| def SOURCE_TAG = 'dev' | |||
| def DESTINATION_TAG = 'test' | |||
| node { | |||
| properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10']]]) | |||
| APP_NAMES.each { appName -> | |||
| stage('Deploying ' + appName + ' to ' + DESTINATION_TAG) { | |||
| openshiftTag destStream: appName, verbose: 'true', destTag: DESTINATION_TAG, srcStream: appName, srcTag: SOURCE_TAG | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,11 @@ | |||
| #========================================================= | |||
| # OpenShift Jenkins pipeline template parameters for: | |||
| # Jenkinsfile: ./jenkins/deploy-to-test-Jenkinsfile | |||
| # Template File: https://raw.githubusercontent.com/BCDevOps/openshift-tools/master/provisioning/pipeline/resources/pipeline-build.json | |||
| #========================================================= | |||
| NAME=deploy-to-test | |||
| # GITHUB_WEBHOOK_SECRET=[a-zA-Z0-9]{40} | |||
| SOURCE_REPOSITORY_URL=https://github.com/bcgov/eDivorce.git | |||
| SOURCE_REPOSITORY_REF=master | |||
| CONTEXT_DIR=jenkins | |||
| JENKINSFILE_PATH=deploy-to-test-Jenkinsfile | |||
| @ -1,88 +0,0 @@ | |||
| # A Quickstart Guide to Setting Up eDivorce on MiniShift | |||
| These instructions assume you have 2 EMPTY projects created in MiniShift: | |||
| - jag-csb-edivorce-tools (BUILD) | |||
| - jag-csb-edivorce-dev (DEV) | |||
| For Minishift deployments we won't bother setting up Jenkins or NGINX. | |||
| ## Uploading Templates into OpenShift | |||
| 1. Clone the project from Github, and then ```cd``` into the openshift/templates directory. | |||
| 2. Log into the OpenShift console to get your command line token. Then log into OpenShift from the command line. | |||
| 3. Upload the templates into OpenShift with the following commands | |||
| Tools templates | |||
| ``` | |||
| oc create -f edivorce-build-template.yaml -n jag-csb-edivorce-tools | |||
| ``` | |||
| Main eDivorce environment template | |||
| ``` | |||
| oc create -f edivorce-environment-template.yaml -n jag-csb-edivorce-dev | |||
| ``` | |||
| ## Setting up the Tools Project | |||
| ### Process the templates in the 'tools' project | |||
| #### These can be processed from the commandline | |||
| ``` | |||
| oc project jag-csb-edivorce-tools | |||
| oc process edivorce-build | oc create -f - | |||
| ``` | |||
| You can monitor the process of the build in the OpenShift console on Minishift. You'll need to wait for it to finish before you can start the next step. | |||
| ## Setting up Dev | |||
| Tag the builds in the tools project so they can be deployed to dev | |||
| ``` | |||
| oc project jag-csb-edivorce-tools | |||
| ``` | |||
| Give the dev project access to Docker images stored in the tools project | |||
| ``` | |||
| oc project jag-csb-edivorce-dev | |||
| oc policy add-role-to-user system:image-puller system:serviceaccount:jag-csb-edivorce-dev:default -n jag-csb-edivorce-tools | |||
| oc policy add-role-to-user edit system:serviceaccount:jag-csb-edivorce-tools:default -n jag-csb-edivorce-dev | |||
| ``` | |||
| Deploy the Django app and the Postgresql DB (Read the section about "Important Configuration Options" above!) | |||
| ``` | |||
| oc process edivorce -v ENVIRONMENT_TYPE=minishift,PROXY_NETWORK=0.0.0.0/0 | oc create -f - | |||
| ``` | |||
| Edit the yaml for the edivorce-django deployment config through the web console | |||
| Find: | |||
| kind: ImageStreamTag | |||
| name: 'edivorce-django:deploy-to-dev' | |||
| Change to: | |||
| kind: ImageStreamTag | |||
| name: 'edivorce-django:latest' | |||
| Deploy Weasyprint | |||
| ``` | |||
| oc deploy weasyprint --latest | |||
| ``` | |||
| ## Create a Route | |||
| Using the web console, create a new route called "minishift" in the jag-csb-edivorce-dev project. The only thing you need to change is the name. Otherwise just use default settings. | |||
| ## Log into eDivorce | |||
| You should be able to find your route in the edivorce-django deployment of the jag-csb-edivorce-dev project. When you are prompted for a username and password you can use the password 'dovorce' with any username you choose. | |||
| @ -0,0 +1,14 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/edivorce-django/edivorce-django-build.yaml | |||
| #========================================================= | |||
| NAME=edivorce-django | |||
| GIT_REPO_URL=https://github.com/bcgov/eDivorce.git | |||
| GIT_REF=master | |||
| SOURCE_CONTEXT_DIR= | |||
| SOURCE_IMAGE_KIND=ImageStreamTag | |||
| SOURCE_IMAGE_NAMESPACE=openshift | |||
| SOURCE_IMAGE_NAME=python | |||
| SOURCE_IMAGE_TAG=3.5 | |||
| PIP_INDEX_URL= | |||
| @ -0,0 +1,17 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/edivorce-django/edivorce-django-deploy.yaml | |||
| #========================================================= | |||
| # NAME=edivorce-django | |||
| # DATABASE_SERVICE_NAME=postgresql | |||
| # DATABASE_ENGINE=postgresql | |||
| # DATABASE_NAME=default | |||
| # APP_CONFIG=gunicorn_config.py | |||
| # #DJANGO_SECRET_KEY=[\w]{50} | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=dev | |||
| BASICAUTH_ENABLED=True | |||
| # BASICAUTH_USERNAME=divorce | |||
| # BASICAUTH_PASSWORD=[a-zA-Z0-9]{16} | |||
| # MEMORY_LIMIT=512Mi | |||
| @ -0,0 +1,32 @@ | |||
| # ================================================================= | |||
| # Special Deployment Parameters needed for Application Deployment | |||
| # ----------------------------------------------------------------- | |||
| # The results need to be encoded as OpenShift template | |||
| # parameters for use with oc process. | |||
| # ================================================================= | |||
| generateUsername() { | |||
| # Generate a random username and Base64 encode the result ... | |||
| _userName=USER_$( cat /dev/urandom | LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 4 | head -n 1 ) | |||
| _userName=$(echo -n "${_userName}"|base64) | |||
| echo ${_userName} | |||
| } | |||
| generatePassword() { | |||
| # Generate a random password and Base64 encode the result ... | |||
| _password=$( cat /dev/urandom | LC_CTYPE=C tr -dc 'a-zA-Z0-9_' | fold -w 16 | head -n 1 ) | |||
| _password=$(echo -n "${_password}"|base64) | |||
| echo ${_password} | |||
| } | |||
| _userName=$(generateUsername) | |||
| _password=$(generatePassword) | |||
| read -r -p $'\n\033[1;33mEnter the network of the upstream proxy (in CIDR notation; for example 0.0.0.0/0); defaults to 0.0.0.0/0:\033[0m\n' PROXY_NETWORK | |||
| if [ -z "${PROXY_NETWORK}" ]; then | |||
| PROXY_NETWORK="0.0.0.0/0" | |||
| fi | |||
| SPECIALDEPLOYPARMS="-p PROXY_NETWORK=${PROXY_NETWORK} -p BASICAUTH_USERNAME=${_userName} -p BASICAUTH_PASSWORD=${_password}" | |||
| echo ${SPECIALDEPLOYPARMS} | |||
| @ -0,0 +1,17 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/edivorce-django/edivorce-django-deploy.yaml | |||
| #========================================================= | |||
| NAME=edivorce-django | |||
| DATABASE_SERVICE_NAME=postgresql | |||
| DATABASE_ENGINE=postgresql | |||
| DATABASE_NAME=default | |||
| APP_CONFIG=gunicorn_config.py | |||
| # DJANGO_SECRET_KEY=[\w]{50} | |||
| IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=dev | |||
| BASICAUTH_ENABLED=False | |||
| BASICAUTH_USERNAME=divorce | |||
| BASICAUTH_PASSWORD=[a-zA-Z0-9]{16} | |||
| MEMORY_LIMIT=512Mi | |||
| @ -0,0 +1,17 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/edivorce-django/edivorce-django-deploy.yaml | |||
| #========================================================= | |||
| # NAME=edivorce-django | |||
| # DATABASE_SERVICE_NAME=postgresql | |||
| # DATABASE_ENGINE=postgresql | |||
| # DATABASE_NAME=default | |||
| # APP_CONFIG=gunicorn_config.py | |||
| # #DJANGO_SECRET_KEY=[\w]{50} | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=prod | |||
| BASICAUTH_ENABLED=False | |||
| # BASICAUTH_USERNAME=divorce | |||
| # BASICAUTH_PASSWORD=[a-zA-Z0-9]{16} | |||
| # MEMORY_LIMIT=512Mi | |||
| @ -0,0 +1,17 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/edivorce-django/edivorce-django-deploy.yaml | |||
| #========================================================= | |||
| # NAME=edivorce-django | |||
| # DATABASE_SERVICE_NAME=postgresql | |||
| # DATABASE_ENGINE=postgresql | |||
| # DATABASE_NAME=default | |||
| # APP_CONFIG=gunicorn_config.py | |||
| # #DJANGO_SECRET_KEY=[\w]{50} | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=test | |||
| BASICAUTH_ENABLED=True | |||
| # BASICAUTH_USERNAME=divorce | |||
| # BASICAUTH_PASSWORD=[a-zA-Z0-9]{16} | |||
| # MEMORY_LIMIT=512Mi | |||
| @ -1,14 +0,0 @@ | |||
| node('master') { | |||
| properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10']]]) | |||
| stage 'buildInTools' | |||
| openshiftBuild(namespace: 'jag-csb-edivorce-tools', buildConfig: 'edivorce-django', showBuildLogs: 'true') | |||
| stage 'deployInDev' | |||
| openshiftTag(namespace: 'jag-csb-edivorce-tools', sourceStream: 'edivorce-django', sourceTag: 'latest', destinationNamespace: 'jag-csb-edivorce-tools', destinationStream: 'edivorce-django', destinationTag: 'deploy-to-dev') | |||
| openshiftDeploy(namespace: 'jag-csb-edivorce-dev', deploymentConfig: 'edivorce-django') | |||
| openshiftScale(namespace: 'jag-csb-edivorce-dev', deploymentConfig: 'edivorce-django',replicaCount: '1') | |||
| } | |||
| @ -1,10 +0,0 @@ | |||
| node('master') { | |||
| properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10']]]) | |||
| stage 'deployInProd' | |||
| openshiftTag(namespace: 'jag-csb-edivorce-tools', sourceStream: 'edivorce-django', sourceTag: 'latest', destinationNamespace: 'jag-csb-edivorce-tools', destinationStream: 'edivorce-django', destinationTag: 'deploy-to-prod') | |||
| openshiftDeploy(namespace: 'jag-csb-edivorce-prod', deploymentConfig: 'edivorce-django') | |||
| openshiftScale(namespace: 'jag-csb-edivorce-prod', deploymentConfig: 'edivorce-django',replicaCount: '2') | |||
| } | |||
| @ -1,11 +0,0 @@ | |||
| node('master') { | |||
| properties([[$class: 'BuildDiscarderProperty', strategy: [$class: 'LogRotator', artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10']]]) | |||
| stage 'deployInTest' | |||
| openshiftTag(namespace: 'jag-csb-edivorce-tools', sourceStream: 'edivorce-django', sourceTag: 'latest', destinationNamespace: 'jag-csb-edivorce-tools', destinationStream: 'edivorce-django', destinationTag: 'deploy-to-test') | |||
| openshiftDeploy(namespace: 'jag-csb-edivorce-test', deploymentConfig: 'edivorce-django') | |||
| openshiftScale(namespace: 'jag-csb-edivorce-test', deploymentConfig: 'edivorce-django',replicaCount: '1') | |||
| } | |||
| @ -1,295 +0,0 @@ | |||
| { | |||
| "kind": "Template", | |||
| "apiVersion": "v1", | |||
| "metadata": { | |||
| "name": "jenkins-pipeline-persistent", | |||
| "creationTimestamp": null, | |||
| "annotations": { | |||
| "description": "Jenkins service, with persistent storage.\nYou must have persistent volumes available in your cluster to use this template.", | |||
| "iconClass": "icon-jenkins", | |||
| "tags": "instant-app,jenkins" | |||
| } | |||
| }, | |||
| "message": "A Jenkins service has been created in your project. The username/password are admin/${JENKINS_PASSWORD}. The tutorial at https://github.com/openshift/origin/blob/master/examples/jenkins/README.md contains more information about using this template.", | |||
| "objects": [ | |||
| { | |||
| "kind": "Route", | |||
| "apiVersion": "v1", | |||
| "metadata": { | |||
| "name": "${JENKINS_SERVICE_NAME}", | |||
| "creationTimestamp": null | |||
| }, | |||
| "spec": { | |||
| "host" : "edivorce-jenkins.pathfinder.gov.bc.ca", | |||
| "to": { | |||
| "kind": "Service", | |||
| "name": "${JENKINS_SERVICE_NAME}" | |||
| }, | |||
| "tls": { | |||
| "termination": "edge", | |||
| "insecureEdgeTerminationPolicy": "Redirect" | |||
| } | |||
| } | |||
| }, | |||
| { | |||
| "kind": "PersistentVolumeClaim", | |||
| "apiVersion": "v1", | |||
| "metadata": { | |||
| "name": "${JENKINS_SERVICE_NAME}" | |||
| }, | |||
| "spec": { | |||
| "accessModes": [ | |||
| "ReadWriteOnce" | |||
| ], | |||
| "resources": { | |||
| "requests": { | |||
| "storage": "${VOLUME_CAPACITY}" | |||
| } | |||
| } | |||
| } | |||
| }, | |||
| { | |||
| "kind": "DeploymentConfig", | |||
| "apiVersion": "v1", | |||
| "metadata": { | |||
| "name": "${JENKINS_SERVICE_NAME}", | |||
| "creationTimestamp": null | |||
| }, | |||
| "spec": { | |||
| "strategy": { | |||
| "type": "Recreate" | |||
| }, | |||
| "triggers": [ | |||
| { | |||
| "type": "ImageChange", | |||
| "imageChangeParams": { | |||
| "automatic": true, | |||
| "containerNames": [ | |||
| "jenkins" | |||
| ], | |||
| "from": { | |||
| "kind": "ImageStreamTag", | |||
| "name": "${JENKINS_IMAGE_STREAM_TAG}", | |||
| "namespace": "${NAMESPACE}" | |||
| }, | |||
| "lastTriggeredImage": "" | |||
| } | |||
| }, | |||
| { | |||
| "type": "ConfigChange" | |||
| } | |||
| ], | |||
| "replicas": 1, | |||
| "selector": { | |||
| "name": "${JENKINS_SERVICE_NAME}" | |||
| }, | |||
| "template": { | |||
| "metadata": { | |||
| "creationTimestamp": null, | |||
| "labels": { | |||
| "name": "${JENKINS_SERVICE_NAME}" | |||
| } | |||
| }, | |||
| "spec": { | |||
| "serviceAccountName": "${JENKINS_SERVICE_NAME}", | |||
| "containers": [ | |||
| { | |||
| "name": "jenkins", | |||
| "image": " ", | |||
| "readinessProbe": { | |||
| "timeoutSeconds": 3, | |||
| "initialDelaySeconds": 3, | |||
| "httpGet": { | |||
| "path": "/login", | |||
| "port": 8080 | |||
| } | |||
| }, | |||
| "livenessProbe": { | |||
| "timeoutSeconds": 3, | |||
| "initialDelaySeconds": 120, | |||
| "httpGet": { | |||
| "path": "/login", | |||
| "port": 8080 | |||
| } | |||
| }, | |||
| "env": [ | |||
| { | |||
| "name": "JENKINS_PASSWORD", | |||
| "value": "${JENKINS_PASSWORD}" | |||
| }, | |||
| { | |||
| "name": "KUBERNETES_MASTER", | |||
| "value": "https://kubernetes.default:443" | |||
| }, | |||
| { | |||
| "name": "KUBERNETES_TRUST_CERTIFICATES", | |||
| "value": "true" | |||
| }, | |||
| { | |||
| "name": "JNLP_SERVICE_NAME", | |||
| "value": "${JNLP_SERVICE_NAME}" | |||
| } | |||
| ], | |||
| "resources": { | |||
| "limits": { | |||
| "memory": "${MEMORY_LIMIT}" | |||
| } | |||
| }, | |||
| "volumeMounts": [ | |||
| { | |||
| "name": "${JENKINS_SERVICE_NAME}-data", | |||
| "mountPath": "/var/lib/jenkins" | |||
| } | |||
| ], | |||
| "terminationMessagePath": "/dev/termination-log", | |||
| "imagePullPolicy": "IfNotPresent", | |||
| "capabilities": {}, | |||
| "securityContext": { | |||
| "capabilities": {}, | |||
| "privileged": false | |||
| } | |||
| } | |||
| ], | |||
| "volumes": [ | |||
| { | |||
| "name": "${JENKINS_SERVICE_NAME}-data", | |||
| "persistentVolumeClaim": { | |||
| "claimName": "${JENKINS_SERVICE_NAME}" | |||
| } | |||
| } | |||
| ], | |||
| "restartPolicy": "Always", | |||
| "dnsPolicy": "ClusterFirst" | |||
| } | |||
| } | |||
| } | |||
| }, | |||
| { | |||
| "kind": "ServiceAccount", | |||
| "apiVersion": "v1", | |||
| "metadata": { | |||
| "name": "${JENKINS_SERVICE_NAME}" | |||
| } | |||
| }, | |||
| { | |||
| "kind": "RoleBinding", | |||
| "apiVersion": "v1", | |||
| "metadata": { | |||
| "name": "${JENKINS_SERVICE_NAME}_edit" | |||
| }, | |||
| "groupNames": null, | |||
| "subjects": [ | |||
| { | |||
| "kind": "ServiceAccount", | |||
| "name": "${JENKINS_SERVICE_NAME}" | |||
| } | |||
| ], | |||
| "roleRef": { | |||
| "name": "edit" | |||
| } | |||
| }, | |||
| { | |||
| "kind": "Service", | |||
| "apiVersion": "v1", | |||
| "metadata": { | |||
| "name": "${JNLP_SERVICE_NAME}" | |||
| }, | |||
| "spec": { | |||
| "ports": [ | |||
| { | |||
| "name": "agent", | |||
| "protocol": "TCP", | |||
| "port": 50000, | |||
| "targetPort": 50000, | |||
| "nodePort": 0 | |||
| } | |||
| ], | |||
| "selector": { | |||
| "name": "${JENKINS_SERVICE_NAME}" | |||
| }, | |||
| "portalIP": "", | |||
| "type": "ClusterIP", | |||
| "sessionAffinity": "None" | |||
| } | |||
| }, | |||
| { | |||
| "kind": "Service", | |||
| "apiVersion": "v1", | |||
| "metadata": { | |||
| "name": "${JENKINS_SERVICE_NAME}", | |||
| "annotations": { | |||
| "service.alpha.openshift.io/dependencies": "[{\"name\": \"${JNLP_SERVICE_NAME}\", \"namespace\": \"\", \"kind\": \"Service\"}]", | |||
| "service.openshift.io/infrastructure": "true" | |||
| }, | |||
| "creationTimestamp": null | |||
| }, | |||
| "spec": { | |||
| "ports": [ | |||
| { | |||
| "name": "web", | |||
| "protocol": "TCP", | |||
| "port": 80, | |||
| "targetPort": 8080, | |||
| "nodePort": 0 | |||
| } | |||
| ], | |||
| "selector": { | |||
| "name": "${JENKINS_SERVICE_NAME}" | |||
| }, | |||
| "portalIP": "", | |||
| "type": "ClusterIP", | |||
| "sessionAffinity": "None" | |||
| } | |||
| } | |||
| ], | |||
| "parameters": [ | |||
| { | |||
| "name": "JENKINS_SERVICE_NAME", | |||
| "displayName": "Jenkins Service Name", | |||
| "description": "The name of the OpenShift Service exposed for the Jenkins container.", | |||
| "value": "jenkins" | |||
| }, | |||
| { | |||
| "name": "JNLP_SERVICE_NAME", | |||
| "displayName": "Jenkins JNLP Service Name", | |||
| "description": "The name of the service used for master/slave communication.", | |||
| "value": "jenkins-jnlp" | |||
| }, | |||
| { | |||
| "name": "JENKINS_PASSWORD", | |||
| "displayName": "Jenkins Password", | |||
| "description": "Password for the Jenkins 'admin' user.", | |||
| "generate": "expression", | |||
| "from": "[a-zA-Z0-9]{16}", | |||
| "required": true | |||
| }, | |||
| { | |||
| "name": "MEMORY_LIMIT", | |||
| "displayName": "Memory Limit", | |||
| "description": "Maximum amount of memory the container can use.", | |||
| "value": "512Mi" | |||
| }, | |||
| { | |||
| "name": "VOLUME_CAPACITY", | |||
| "displayName": "Volume Capacity", | |||
| "description": "Volume space available for data, e.g. 512Mi, 2Gi.", | |||
| "value": "1Gi", | |||
| "required": true | |||
| }, | |||
| { | |||
| "name": "NAMESPACE", | |||
| "displayName": "Jenkins ImageStream Namespace", | |||
| "description": "The OpenShift Namespace where the Jenkins ImageStream resides.", | |||
| "value": "openshift" | |||
| }, | |||
| { | |||
| "name": "JENKINS_IMAGE_STREAM_TAG", | |||
| "displayName": "Jenkins ImageStreamTag", | |||
| "description": "Name of the ImageStreamTag to be used for the Jenkins image.", | |||
| "value": "jenkins:latest" | |||
| } | |||
| ], | |||
| "labels": { | |||
| "template": "jenkins-persistent-template" | |||
| } | |||
| } | |||
| @ -1,111 +0,0 @@ | |||
| --- | |||
| kind: Template | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: edivorce-build-pipeline | |||
| labels: | |||
| template: edivorce-build-pipeline | |||
| objects: | |||
| - kind: BuildConfig | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: build-and-deploy-to-dev | |||
| labels: | |||
| name: build-and-deploy-to-dev | |||
| annotations: | |||
| pipeline.alpha.openshift.io/uses: '[{"name": "", "namespace": "", "kind": "DeploymentConfig"}]' | |||
| spec: | |||
| triggers: | |||
| - | |||
| type: GitHub | |||
| github: | |||
| secret: ${GITHUB_WEBHOOK_SECRET} | |||
| - | |||
| type: Generic | |||
| generic: | |||
| secret: ${GITHUB_WEBHOOK_SECRET} | |||
| runPolicy: Serial | |||
| source: | |||
| type: Git | |||
| git: | |||
| uri: 'https://github.com/bcgov/eDivorce' | |||
| ref: master | |||
| contextDir: openshift/jenkins | |||
| strategy: | |||
| type: JenkinsPipeline | |||
| jenkinsPipelineStrategy: | |||
| jenkinsfilePath: build-and-deploy-to-dev | |||
| output: | |||
| resources: | |||
| postCommit: | |||
| - kind: BuildConfig | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: deploy-to-prod | |||
| labels: | |||
| name: deploy-to-prod | |||
| annotations: | |||
| pipeline.alpha.openshift.io/uses: '[{"name": "", "namespace": "", "kind": "DeploymentConfig"}]' | |||
| spec: | |||
| triggers: | |||
| - | |||
| type: GitHub | |||
| github: | |||
| secret: ${GITHUB_WEBHOOK_SECRET} | |||
| - | |||
| type: Generic | |||
| generic: | |||
| secret: ${GITHUB_WEBHOOK_SECRET} | |||
| runPolicy: Serial | |||
| source: | |||
| type: Git | |||
| git: | |||
| uri: 'https://github.com/bcgov/eDivorce' | |||
| ref: master | |||
| contextDir: openshift/jenkins | |||
| strategy: | |||
| type: JenkinsPipeline | |||
| jenkinsPipelineStrategy: | |||
| jenkinsfilePath: deploy-to-prod | |||
| output: | |||
| resources: | |||
| postCommit: | |||
| - kind: BuildConfig | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: deploy-to-test | |||
| labels: | |||
| name: deploy-to-test | |||
| annotations: | |||
| pipeline.alpha.openshift.io/uses: '[{"name": "", "namespace": "", "kind": "DeploymentConfig"}]' | |||
| spec: | |||
| triggers: | |||
| - | |||
| type: GitHub | |||
| github: | |||
| secret: ${GITHUB_WEBHOOK_SECRET} | |||
| - | |||
| type: Generic | |||
| generic: | |||
| secret: ${GITHUB_WEBHOOK_SECRET} | |||
| runPolicy: Serial | |||
| source: | |||
| type: Git | |||
| git: | |||
| uri: 'https://github.com/bcgov/eDivorce' | |||
| ref: master | |||
| contextDir: openshift/jenkins | |||
| strategy: | |||
| type: JenkinsPipeline | |||
| jenkinsPipelineStrategy: | |||
| jenkinsfilePath: deploy-to-test | |||
| output: | |||
| resources: | |||
| postCommit: | |||
| parameters: | |||
| - name: GITHUB_WEBHOOK_SECRET | |||
| displayName: GitHub Webhook Secret | |||
| description: A secret string used to configure the GitHub webhook. | |||
| generate: expression | |||
| from: "[a-zA-Z0-9]{40}" | |||
| @ -0,0 +1,13 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/nginx-proxy/nginx-proxy-build.yaml | |||
| #========================================================= | |||
| NAME=nginx-proxy | |||
| GIT_REPO_URL=https://github.com/bcgov/eDivorce.git | |||
| GIT_REF=master | |||
| SOURCE_CONTEXT_DIR=/openshift/templates/nginx-proxy | |||
| SOURCE_IMAGE_KIND=ImageStreamTag | |||
| SOURCE_IMAGE_NAME=s2i-nginx | |||
| SOURCE_IMAGE_TAG=latest | |||
| NGINX_PROXY_URL=http://edivorce-django:8080/ | |||
| @ -0,0 +1,11 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/nginx-proxy/nginx-proxy-deploy.yaml | |||
| #========================================================= | |||
| # NAME=nginx-proxy | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=dev | |||
| APPLICATION_DOMAIN=edivorce-dev.pathfinder.gov.bc.ca | |||
| SITEMINDER_APPLICATION_DOMAIN=edivorce-dev.pathfinder.bcgov | |||
| # SITEMINDER_WHITE_LIST= | |||
| @ -0,0 +1,17 @@ | |||
| # ================================================================================================================ | |||
| # Special Deployment Parameters needed for injecting a user supplied white-list into the deployment configuration | |||
| # ---------------------------------------------------------------------------------------------------------------- | |||
| # The results need to be encoded as OpenShift template parameters for use with oc process. | |||
| # ================================================================================================================ | |||
| # Define the name of the override param file. | |||
| _overrideParamFile=$(basename ${0%.*}).param | |||
| # Ask the user to supply the list of IP addresses ... | |||
| read -r -p $'\n\033[1;33mEnter the white list of trusted IP addresses that should be allowed to access the SiteMinder route (as a space delimited list of IP addresses):\033[0m\n' SITEMINDER_WHITE_LIST | |||
| # Write the results into a param file, since you can't pass space delimited parameters on the command line using -p or --param | |||
| echo "SITEMINDER_WHITE_LIST=${SITEMINDER_WHITE_LIST}" > ${_overrideParamFile} | |||
| SPECIALDEPLOYPARMS="--param-file=${_overrideParamFile}" | |||
| echo ${SPECIALDEPLOYPARMS} | |||
| @ -0,0 +1,11 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/nginx-proxy/nginx-proxy-deploy.yaml | |||
| #========================================================= | |||
| NAME=nginx-proxy | |||
| IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=dev | |||
| APPLICATION_DOMAIN=edivorce-dev.pathfinder.gov.bc.ca | |||
| SITEMINDER_APPLICATION_DOMAIN=edivorce-dev.pathfinder.bcgov | |||
| SITEMINDER_WHITE_LIST= | |||
| @ -0,0 +1,11 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/nginx-proxy/nginx-proxy-deploy.yaml | |||
| #========================================================= | |||
| # NAME=nginx-proxy | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=prod | |||
| APPLICATION_DOMAIN=edivorce-prod.pathfinder.gov.bc.ca | |||
| SITEMINDER_APPLICATION_DOMAIN=edivorce-prod.pathfinder.bcgov | |||
| # SITEMINDER_WHITE_LIST= | |||
| @ -0,0 +1,11 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/nginx-proxy/nginx-proxy-deploy.yaml | |||
| #========================================================= | |||
| # NAME=nginx-proxy | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=test | |||
| APPLICATION_DOMAIN=edivorce-test.pathfinder.gov.bc.ca | |||
| SITEMINDER_APPLICATION_DOMAIN=edivorce-test.pathfinder.bcgov | |||
| # SITEMINDER_WHITE_LIST= | |||
| @ -0,0 +1,10 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/postgresql/postgresql-build.yaml | |||
| #========================================================= | |||
| NAME=postgresql | |||
| OUTPUT_IMAGE_TAG=latest | |||
| SOURCE_IMAGE_KIND=DockerImage | |||
| SOURCE_IMAGE_NAME=registry.access.redhat.com/rhscl/postgresql-95-rhel7 | |||
| SOURCE_IMAGE_TAG=9.5 | |||
| @ -0,0 +1,16 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/postgresql/postgresql-deploy.yaml | |||
| #========================================================= | |||
| # NAME=postgresql | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| # SOURCE_IMAGE_NAME=postgresql | |||
| TAG_NAME=dev | |||
| # POSTGRESQL_DATABASE_NAME=default | |||
| # POSTGRESQL_USER=[a-zA-Z_][a-zA-Z0-9_]{10} | |||
| # POSTGRESQL_PASSWORD=[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]{16} | |||
| # POSTGRESQL_ADMIN_PASSWORD=[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]{16} | |||
| # MOUNT_PATH=/var/lib/pgsql/data | |||
| # PERSISTENT_VOLUME_SIZE=1Gi | |||
| # MEMORY_LIMIT=512Mi | |||
| @ -0,0 +1,28 @@ | |||
| # ====================================================== | |||
| # Special Deployment Parameters needed for DB Deployment | |||
| # ------------------------------------------------------ | |||
| # The results need to be encoded as OpenShift template | |||
| # parameters for use with oc process. | |||
| # ====================================================== | |||
| generateUsername() { | |||
| # Generate a random username and Base64 encode the result ... | |||
| _userName=USER_$( cat /dev/urandom | LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 4 | head -n 1 ) | |||
| _userName=$(echo -n "${_userName}"|base64) | |||
| echo ${_userName} | |||
| } | |||
| generatePassword() { | |||
| # Generate a random password and Base64 encode the result ... | |||
| _password=$( cat /dev/urandom | LC_CTYPE=C tr -dc 'a-zA-Z0-9_' | fold -w 16 | head -n 1 ) | |||
| _password=$(echo -n "${_password}"|base64) | |||
| echo ${_password} | |||
| } | |||
| _userName=$(generateUsername) | |||
| _password=$(generatePassword) | |||
| _adminPassword=$(generatePassword) | |||
| SPECIALDEPLOYPARMS="-p POSTGRESQL_USER=${_userName} -p POSTGRESQL_PASSWORD=${_password} -p POSTGRESQL_ADMIN_PASSWORD=${_adminPassword}" | |||
| echo ${SPECIALDEPLOYPARMS} | |||
| @ -0,0 +1,16 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/postgresql/postgresql-deploy.yaml | |||
| #========================================================= | |||
| NAME=postgresql | |||
| IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| SOURCE_IMAGE_NAME=postgresql | |||
| TAG_NAME=dev | |||
| POSTGRESQL_DATABASE_NAME=default | |||
| POSTGRESQL_USER=[a-zA-Z_][a-zA-Z0-9_]{10} | |||
| POSTGRESQL_PASSWORD=[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]{16} | |||
| POSTGRESQL_ADMIN_PASSWORD=[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]{16} | |||
| MOUNT_PATH=/var/lib/pgsql/data | |||
| PERSISTENT_VOLUME_SIZE=1Gi | |||
| MEMORY_LIMIT=512Mi | |||
| @ -0,0 +1,16 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/postgresql/postgresql-deploy.yaml | |||
| #========================================================= | |||
| # NAME=postgresql | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| # SOURCE_IMAGE_NAME=postgresql | |||
| TAG_NAME=prod | |||
| # POSTGRESQL_DATABASE_NAME=default | |||
| # POSTGRESQL_USER=[a-zA-Z_][a-zA-Z0-9_]{10} | |||
| # POSTGRESQL_PASSWORD=[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]{16} | |||
| # POSTGRESQL_ADMIN_PASSWORD=[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]{16} | |||
| # MOUNT_PATH=/var/lib/pgsql/data | |||
| # PERSISTENT_VOLUME_SIZE=1Gi | |||
| # MEMORY_LIMIT=512Mi | |||
| @ -0,0 +1,16 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/postgresql/postgresql-deploy.yaml | |||
| #========================================================= | |||
| # NAME=postgresql | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| # SOURCE_IMAGE_NAME=postgresql | |||
| TAG_NAME=test | |||
| # POSTGRESQL_DATABASE_NAME=default | |||
| # POSTGRESQL_USER=[a-zA-Z_][a-zA-Z0-9_]{10} | |||
| # POSTGRESQL_PASSWORD=[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]{16} | |||
| # POSTGRESQL_ADMIN_PASSWORD=[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]{16} | |||
| # MOUNT_PATH=/var/lib/pgsql/data | |||
| # PERSISTENT_VOLUME_SIZE=1Gi | |||
| # MEMORY_LIMIT=512Mi | |||
| @ -0,0 +1,25 @@ | |||
| export PROJECT_NAMESPACE=${PROJECT_NAMESPACE:-jag-csb-edivorce} | |||
| export GIT_URI=${GIT_URI:-"https://github.com/bcgov/eDivorce.git"} | |||
| export GIT_REF=${GIT_REF:-"master"} | |||
| # The project components | |||
| # - They are all contained under the main OpenShift folder. | |||
| 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" | |||
| # 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 skip_git_overrides="" | |||
| # The builds to be triggered after buildconfigs created (not auto-triggered) | |||
| export builds="" | |||
| # The images to be tagged after build | |||
| export images="nginx-proxy weasyprint edivorce-django postgresql" | |||
| # The routes for the project | |||
| export routes="nginx-proxy" | |||
| @ -0,0 +1,192 @@ | |||
| --- | |||
| kind: Template | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: edivorce | |||
| annotations: | |||
| description: An example Django application with a PostgreSQL database | |||
| tags: edivorce,python,django,postgresql | |||
| iconClass: icon-python | |||
| labels: | |||
| template: edivorce-environment-template | |||
| objects: | |||
| - kind: Service | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| annotations: | |||
| description: Exposes and load balances the application pods | |||
| spec: | |||
| ports: | |||
| - name: web | |||
| port: 8080 | |||
| targetPort: 8080 | |||
| selector: | |||
| name: "${NAME}" | |||
| - kind: DeploymentConfig | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| annotations: | |||
| description: Defines how to deploy the application server | |||
| spec: | |||
| strategy: | |||
| type: Rolling | |||
| triggers: | |||
| - type: ImageChange | |||
| imageChangeParams: | |||
| automatic: true | |||
| containerNames: | |||
| - edivorce-django | |||
| from: | |||
| kind: ImageStreamTag | |||
| namespace: "${IMAGE_NAMESPACE}" | |||
| name: "${NAME}:${TAG_NAME}" | |||
| - type: ConfigChange | |||
| replicas: 1 | |||
| selector: | |||
| name: "${NAME}" | |||
| template: | |||
| metadata: | |||
| name: "${NAME}" | |||
| labels: | |||
| name: "${NAME}" | |||
| spec: | |||
| containers: | |||
| - name: edivorce-django | |||
| image: " " | |||
| ports: | |||
| - containerPort: 8080 | |||
| readinessProbe: | |||
| timeoutSeconds: 3 | |||
| initialDelaySeconds: 3 | |||
| httpGet: | |||
| path: "/health" | |||
| port: 8080 | |||
| livenessProbe: | |||
| timeoutSeconds: 3 | |||
| initialDelaySeconds: 30 | |||
| httpGet: | |||
| path: "/health" | |||
| port: 8080 | |||
| env: | |||
| - name: DATABASE_SERVICE_NAME | |||
| value: "${DATABASE_SERVICE_NAME}" | |||
| - name: DATABASE_ENGINE | |||
| value: "${DATABASE_ENGINE}" | |||
| - name: DATABASE_NAME | |||
| value: "${DATABASE_NAME}" | |||
| - name: DATABASE_USER | |||
| valueFrom: | |||
| secretKeyRef: | |||
| key: database-user | |||
| name: postgresql | |||
| - name: DATABASE_PASSWORD | |||
| valueFrom: | |||
| secretKeyRef: | |||
| key: database-password | |||
| name: postgresql | |||
| - name: APP_CONFIG | |||
| value: "${APP_CONFIG}" | |||
| - name: DJANGO_SECRET_KEY | |||
| value: "${DJANGO_SECRET_KEY}" | |||
| - name: ENVIRONMENT_TYPE | |||
| value: "${TAG_NAME}" | |||
| - name: PROXY_NETWORK | |||
| value: "${PROXY_NETWORK}" | |||
| - name: BASICAUTH_ENABLED | |||
| value: "${BASICAUTH_ENABLED}" | |||
| - name: BASICAUTH_USERNAME | |||
| valueFrom: | |||
| secretKeyRef: | |||
| key: basic-auth-username | |||
| name: ${NAME} | |||
| - name: BASICAUTH_PASSWORD | |||
| valueFrom: | |||
| secretKeyRef: | |||
| key: basic-auth-password | |||
| name: ${NAME} | |||
| resources: | |||
| limits: | |||
| memory: "${MEMORY_LIMIT}" | |||
| - kind: Secret | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| labels: | |||
| app: "${NAME}" | |||
| data: | |||
| basic-auth-password: "${BASICAUTH_PASSWORD}" | |||
| basic-auth-username: "${BASICAUTH_USERNAME}" | |||
| type: Opaque | |||
| - kind: HorizontalPodAutoscaler | |||
| apiVersion: autoscaling/v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| labels: | |||
| app: "${NAME}" | |||
| spec: | |||
| scaleTargetRef: | |||
| kind: DeploymentConfig | |||
| name: "${NAME}" | |||
| minReplicas: 1 | |||
| maxReplicas: 4 | |||
| parameters: | |||
| - name: NAME | |||
| displayName: Name | |||
| description: The name assigned to all of the frontend objects defined in this template. | |||
| required: true | |||
| value: edivorce-django | |||
| - name: DATABASE_SERVICE_NAME | |||
| displayName: Database Service Name | |||
| required: true | |||
| value: postgresql | |||
| - name: DATABASE_ENGINE | |||
| displayName: Database Engine | |||
| description: 'Database engine: postgresql, mysql or sqlite (default).' | |||
| required: true | |||
| value: postgresql | |||
| - name: DATABASE_NAME | |||
| displayName: Database Name | |||
| required: true | |||
| value: default | |||
| - name: APP_CONFIG | |||
| displayName: Application Configuration File Path | |||
| description: Relative path to Gunicorn configuration file (optional). | |||
| value: gunicorn_config.py | |||
| - name: DJANGO_SECRET_KEY | |||
| displayName: Django Secret Key | |||
| description: Set this to a long random string. | |||
| generate: expression | |||
| from: "[\\w]{50}" | |||
| - name: IMAGE_NAMESPACE | |||
| displayName: Namespace containing application images. | |||
| required: true | |||
| value: jag-csb-edivorce-tools | |||
| - name: TAG_NAME | |||
| displayName: Environment TAG name | |||
| description: The TAG name for this environment, e.g., dev, test, prod, or minishift. | |||
| required: true | |||
| value: dev | |||
| - name: PROXY_NETWORK | |||
| displayName: Network of upstream proxy (CIDR notation 0.0.0.0/0) | |||
| required: true | |||
| - name: BASICAUTH_ENABLED | |||
| displayName: Enable basic auth (recommended for Dev and Test environments) | |||
| required: true | |||
| value: "False" | |||
| - name: BASICAUTH_USERNAME | |||
| displayName: Basic Auth Username | |||
| description: Basic Auth Username. Needs to be basee64 encoded. | |||
| required: true | |||
| value: divorce | |||
| - name: BASICAUTH_PASSWORD | |||
| displayName: Basic Auth Password | |||
| description: Basic Auth Password. Needs to be basee64 encoded. | |||
| generate: expression | |||
| from: "[a-zA-Z0-9]{16}" | |||
| - name: MEMORY_LIMIT | |||
| displayName: Memory Limit | |||
| required: true | |||
| description: Maximum amount of memory the Django container can use. | |||
| value: 512Mi | |||
| @ -1,353 +0,0 @@ | |||
| --- | |||
| kind: Template | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: edivorce | |||
| annotations: | |||
| description: An example Django application with a PostgreSQL database | |||
| tags: edivorce,python,django,postgresql | |||
| iconClass: icon-python | |||
| labels: | |||
| template: edivorce-environment-template | |||
| objects: | |||
| - kind: Service | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| annotations: | |||
| description: Exposes and load balances the application pods | |||
| spec: | |||
| ports: | |||
| - name: web | |||
| port: 8080 | |||
| targetPort: 8080 | |||
| selector: | |||
| name: "${NAME}" | |||
| - kind: DeploymentConfig | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| annotations: | |||
| description: Defines how to deploy the application server | |||
| spec: | |||
| strategy: | |||
| type: Rolling | |||
| triggers: | |||
| - type: ImageChange | |||
| imageChangeParams: | |||
| automatic: true | |||
| containerNames: | |||
| - edivorce-django | |||
| from: | |||
| kind: ImageStreamTag | |||
| namespace: "${APP_IMAGE_NAMESPACE}" | |||
| name: "${APP_IMAGE_NAME}:deploy-to-${ENVIRONMENT_TYPE}" | |||
| - type: ConfigChange | |||
| replicas: 1 | |||
| selector: | |||
| name: "${NAME}" | |||
| template: | |||
| metadata: | |||
| name: "${NAME}" | |||
| labels: | |||
| name: "${NAME}" | |||
| spec: | |||
| containers: | |||
| - name: edivorce-django | |||
| image: " " | |||
| ports: | |||
| - containerPort: 8080 | |||
| readinessProbe: | |||
| timeoutSeconds: 3 | |||
| initialDelaySeconds: 3 | |||
| httpGet: | |||
| path: "/health" | |||
| port: 8080 | |||
| livenessProbe: | |||
| timeoutSeconds: 3 | |||
| initialDelaySeconds: 30 | |||
| httpGet: | |||
| path: "/health" | |||
| port: 8080 | |||
| env: | |||
| - name: DATABASE_SERVICE_NAME | |||
| value: "${DATABASE_SERVICE_NAME}" | |||
| - name: DATABASE_ENGINE | |||
| value: "${DATABASE_ENGINE}" | |||
| - name: DATABASE_NAME | |||
| value: "${DATABASE_NAME}" | |||
| - name: DATABASE_USER | |||
| value: "${DATABASE_USER}" | |||
| - name: DATABASE_PASSWORD | |||
| value: "${DATABASE_PASSWORD}" | |||
| - name: APP_CONFIG | |||
| value: "${APP_CONFIG}" | |||
| - name: DJANGO_SECRET_KEY | |||
| value: "${DJANGO_SECRET_KEY}" | |||
| - name: ENVIRONMENT_TYPE | |||
| value: "${ENVIRONMENT_TYPE}" | |||
| - name: PROXY_NETWORK | |||
| value: "${PROXY_NETWORK}" | |||
| - name: BASICAUTH_ENABLED | |||
| value: "${BASICAUTH_ENABLED}" | |||
| - name: BASICAUTH_USERNAME | |||
| value: "${BASICAUTH_USERNAME}" | |||
| - name: BASICAUTH_PASSWORD | |||
| value: "${BASICAUTH_PASSWORD}" | |||
| resources: | |||
| limits: | |||
| memory: "${MEMORY_LIMIT}" | |||
| - kind: PersistentVolumeClaim | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${DATABASE_SERVICE_NAME}" | |||
| spec: | |||
| accessModes: | |||
| - ReadWriteOnce | |||
| resources: | |||
| requests: | |||
| storage: "${VOLUME_CAPACITY}" | |||
| - kind: Service | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${DATABASE_SERVICE_NAME}" | |||
| annotations: | |||
| description: Exposes the database server | |||
| spec: | |||
| ports: | |||
| - name: postgresql | |||
| port: 5432 | |||
| targetPort: 5432 | |||
| selector: | |||
| name: "${DATABASE_SERVICE_NAME}" | |||
| - kind: DeploymentConfig | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${DATABASE_SERVICE_NAME}" | |||
| annotations: | |||
| description: Defines how to deploy the database | |||
| spec: | |||
| strategy: | |||
| type: Recreate | |||
| triggers: | |||
| - type: ImageChange | |||
| imageChangeParams: | |||
| automatic: true | |||
| containerNames: | |||
| - postgresql | |||
| from: | |||
| kind: ImageStreamTag | |||
| namespace: "${NAMESPACE}" | |||
| name: postgresql:9.5 | |||
| - type: ConfigChange | |||
| replicas: 1 | |||
| selector: | |||
| name: "${DATABASE_SERVICE_NAME}" | |||
| template: | |||
| metadata: | |||
| name: "${DATABASE_SERVICE_NAME}" | |||
| labels: | |||
| name: "${DATABASE_SERVICE_NAME}" | |||
| spec: | |||
| volumes: | |||
| - name: "${DATABASE_SERVICE_NAME}-data" | |||
| persistentVolumeClaim: | |||
| claimName: "${DATABASE_SERVICE_NAME}" | |||
| containers: | |||
| - name: postgresql | |||
| image: " " | |||
| ports: | |||
| - containerPort: 5432 | |||
| env: | |||
| - name: POSTGRESQL_USER | |||
| value: "${DATABASE_USER}" | |||
| - name: POSTGRESQL_PASSWORD | |||
| value: "${DATABASE_PASSWORD}" | |||
| - name: POSTGRESQL_DATABASE | |||
| value: "${DATABASE_NAME}" | |||
| volumeMounts: | |||
| - name: "${DATABASE_SERVICE_NAME}-data" | |||
| mountPath: "/var/lib/pgsql/data" | |||
| readinessProbe: | |||
| timeoutSeconds: 1 | |||
| initialDelaySeconds: 5 | |||
| exec: | |||
| command: | |||
| - "/bin/sh" | |||
| - "-i" | |||
| - "-c" | |||
| - psql -h 127.0.0.1 -U ${POSTGRESQL_USER} -q -d ${POSTGRESQL_DATABASE} -c 'SELECT 1' | |||
| livenessProbe: | |||
| timeoutSeconds: 1 | |||
| initialDelaySeconds: 30 | |||
| tcpSocket: | |||
| port: 5432 | |||
| resources: | |||
| limits: | |||
| memory: "${MEMORY_POSTGRESQL_LIMIT}" | |||
| - kind: ImageStream | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: weasyprint | |||
| labels: | |||
| name: weasyprint | |||
| spec: | |||
| tags: | |||
| - name: latest | |||
| annotations: | |||
| openshift.io/imported-from: aquavitae/weasyprint | |||
| from: | |||
| kind: DockerImage | |||
| name: aquavitae/weasyprint | |||
| - kind: Service | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: weasyprint | |||
| labels: | |||
| name: weasyprint | |||
| spec: | |||
| ports: | |||
| - name: 5001-tcp | |||
| protocol: TCP | |||
| port: 5001 | |||
| targetPort: 5001 | |||
| selector: | |||
| name: weasyprint | |||
| - kind: DeploymentConfig | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: weasyprint | |||
| labels: | |||
| app: weasyprint | |||
| annotations: | |||
| description: Weasyprint microservice using aquavitae/weasyprint | |||
| spec: | |||
| strategy: | |||
| type: Rolling | |||
| triggers: | |||
| - type: ImageChange | |||
| imageChangeParams: | |||
| automatic: true | |||
| containerNames: | |||
| - weasyprint | |||
| from: | |||
| kind: ImageStreamTag | |||
| namespace: aquavitae | |||
| name: 'weasyprint:latest' | |||
| - type: ConfigChange | |||
| replicas: 1 | |||
| selector: | |||
| name: weasyprint | |||
| template: | |||
| metadata: | |||
| name: weasyprint | |||
| labels: | |||
| name: weasyprint | |||
| annotations: | |||
| openshift.io/container.weasyprint.image.entrypoint: '["/bin/sh","-c","gunicorn --bind 0.0.0.0:5001 wsgi:app"]' | |||
| spec: | |||
| containers: | |||
| - name: weasyprint | |||
| image: 'aquavitae/weasyprint' | |||
| ports: | |||
| - containerPort: 5001 | |||
| protocol: TCP | |||
| resources: | |||
| limits: | |||
| cpu: '2' | |||
| memory: 1Gi | |||
| requests: | |||
| cpu: 250m | |||
| memory: 512Mi | |||
| livenessProbe: | |||
| httpGet: | |||
| path: /health | |||
| port: 5001 | |||
| scheme: HTTP | |||
| initialDelaySeconds: 120 | |||
| timeoutSeconds: 30 | |||
| periodSeconds: 60 | |||
| successThreshold: 1 | |||
| failureThreshold: 5 | |||
| parameters: | |||
| - name: NAME | |||
| displayName: Name | |||
| description: The name assigned to all of the frontend objects defined in this template. | |||
| required: true | |||
| value: edivorce-django | |||
| - name: NAMESPACE | |||
| displayName: Namespace | |||
| required: true | |||
| description: The OpenShift Namespace where the ImageStream resides. | |||
| value: openshift | |||
| - name: MEMORY_LIMIT | |||
| displayName: Memory Limit | |||
| required: true | |||
| description: Maximum amount of memory the Django container can use. | |||
| value: 512Mi | |||
| - name: MEMORY_POSTGRESQL_LIMIT | |||
| displayName: Memory Limit (PostgreSQL) | |||
| required: true | |||
| description: Maximum amount of memory the PostgreSQL container can use. | |||
| value: 512Mi | |||
| - name: VOLUME_CAPACITY | |||
| displayName: Volume Capacity | |||
| description: Volume space available for data, e.g. 512Mi, 2Gi | |||
| value: 1Gi | |||
| required: true | |||
| - name: DATABASE_SERVICE_NAME | |||
| displayName: Database Service Name | |||
| required: true | |||
| value: postgresql | |||
| - name: DATABASE_ENGINE | |||
| displayName: Database Engine | |||
| required: true | |||
| description: 'Database engine: postgresql, mysql or sqlite (default).' | |||
| value: postgresql | |||
| - name: DATABASE_NAME | |||
| displayName: Database Name | |||
| required: true | |||
| value: default | |||
| - name: DATABASE_USER | |||
| displayName: Database Username | |||
| required: true | |||
| value: django | |||
| - name: DATABASE_PASSWORD | |||
| displayName: Database User Password | |||
| generate: expression | |||
| from: "[a-zA-Z0-9]{16}" | |||
| - name: APP_CONFIG | |||
| displayName: Application Configuration File Path | |||
| value: gunicorn_config.py | |||
| description: Relative path to Gunicorn configuration file (optional). | |||
| - name: DJANGO_SECRET_KEY | |||
| displayName: Django Secret Key | |||
| description: Set this to a long random string. | |||
| generate: expression | |||
| from: "[\\w]{50}" | |||
| - name: APP_IMAGE_NAME | |||
| displayName: Application image name. | |||
| value: edivorce-django | |||
| required": true | |||
| - name: APP_IMAGE_NAMESPACE | |||
| displayName: Namespace containing application images. | |||
| value: jag-csb-edivorce-tools | |||
| required: true | |||
| - name: ENVIRONMENT_TYPE | |||
| displayName: Type of environnment (dev,test,prod or minishift). | |||
| required: true | |||
| - name: PROXY_NETWORK | |||
| displayName: Network of upstream proxy (CIDR notation 0.0.0.0/0) | |||
| required: true | |||
| - name: BASICAUTH_ENABLED | |||
| displayName: Enable basic auth (recommended for Dev and Test environments) | |||
| value: "False" | |||
| required: true | |||
| - name: BASICAUTH_USERNAME | |||
| displayName: Username for basic auth | |||
| value: divorce | |||
| required: true | |||
| - name: BASICAUTH_PASSWORD | |||
| displayName: Password for basic auth | |||
| generate: expression | |||
| from: "[a-zA-Z0-9]{16}" | |||
| @ -0,0 +1,45 @@ | |||
| --- | |||
| kind: Template | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}-imagestream-template" | |||
| objects: | |||
| - kind: ImageStream | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| spec: | |||
| tags: | |||
| - name: "${OUTPUT_IMAGE_TAG}" | |||
| annotations: | |||
| from: | |||
| kind: "${SOURCE_IMAGE_KIND}" | |||
| name: "${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG}" | |||
| importPolicy: | |||
| scheduled: true | |||
| parameters: | |||
| - name: NAME | |||
| displayName: Name | |||
| description: The name assigned to all of the frontend objects defined in this template. You should keep this as default unless your know what your doing. | |||
| required: true | |||
| value: postgresql | |||
| - name: OUTPUT_IMAGE_TAG | |||
| displayName: Output Image Tag | |||
| description: The tag given to the built image. | |||
| required: true | |||
| value: latest | |||
| - name: SOURCE_IMAGE_KIND | |||
| displayName: Source Image Kind | |||
| description: The 'kind' (type) of the source image; typically ImageStreamTag, or DockerImage. | |||
| required: true | |||
| value: DockerImage | |||
| - name: SOURCE_IMAGE_NAME | |||
| displayName: Source Image Name | |||
| description: The name of the source image. | |||
| required: true | |||
| value: registry.access.redhat.com/rhscl/postgresql-95-rhel7 | |||
| - name: SOURCE_IMAGE_TAG | |||
| displayName: Source Image Tag | |||
| description: The tag of the source image. | |||
| required: true | |||
| value: '9.5' | |||
| @ -0,0 +1,213 @@ | |||
| --- | |||
| kind: Template | |||
| apiVersion: v1 | |||
| metadata: | |||
| annotations: | |||
| description: Deployment template for a postgresql server with persistent storage. | |||
| tags: "${NAME}" | |||
| name: "${NAME}-persistent-template" | |||
| objects: | |||
| - kind: DeploymentConfig | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| generation: 1 | |||
| labels: | |||
| app: "${NAME}-persistent" | |||
| template: "${NAME}-persistent-template" | |||
| spec: | |||
| strategy: | |||
| type: Recreate | |||
| recreateParams: | |||
| timeoutSeconds: 600 | |||
| resources: {} | |||
| activeDeadlineSeconds: 21600 | |||
| triggers: | |||
| - type: ImageChange | |||
| imageChangeParams: | |||
| automatic: true | |||
| containerNames: | |||
| - "${NAME}" | |||
| from: | |||
| kind: ImageStreamTag | |||
| namespace: "${IMAGE_NAMESPACE}" | |||
| name: "${SOURCE_IMAGE_NAME}:${TAG_NAME}" | |||
| - type: ConfigChange | |||
| replicas: 1 | |||
| test: false | |||
| selector: | |||
| name: "${NAME}" | |||
| template: | |||
| metadata: | |||
| labels: | |||
| name: "${NAME}" | |||
| spec: | |||
| volumes: | |||
| - name: "${NAME}-data" | |||
| persistentVolumeClaim: | |||
| claimName: "${NAME}" | |||
| containers: | |||
| - name: "${NAME}" | |||
| image: " " | |||
| ports: | |||
| - containerPort: 5432 | |||
| protocol: TCP | |||
| env: | |||
| - name: POSTGRESQL_USER | |||
| valueFrom: | |||
| secretKeyRef: | |||
| name: "${NAME}" | |||
| key: database-user | |||
| - name: POSTGRESQL_PASSWORD | |||
| valueFrom: | |||
| secretKeyRef: | |||
| name: "${NAME}" | |||
| key: database-password | |||
| - name: POSTGRESQL_ADMIN_PASSWORD | |||
| valueFrom: | |||
| secretKeyRef: | |||
| name: "${NAME}" | |||
| key: admin-password | |||
| - name: POSTGRESQL_DATABASE | |||
| value: "${POSTGRESQL_DATABASE_NAME}" | |||
| resources: | |||
| limits: | |||
| memory: "${MEMORY_LIMIT}" | |||
| volumeMounts: | |||
| - name: "${NAME}-data" | |||
| mountPath: "${MOUNT_PATH}" | |||
| livenessProbe: | |||
| tcpSocket: | |||
| port: 5432 | |||
| initialDelaySeconds: 30 | |||
| timeoutSeconds: 1 | |||
| periodSeconds: 10 | |||
| successThreshold: 1 | |||
| failureThreshold: 3 | |||
| readinessProbe: | |||
| exec: | |||
| command: | |||
| - "/bin/sh" | |||
| - "-i" | |||
| - "-c" | |||
| - psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1' | |||
| initialDelaySeconds: 5 | |||
| timeoutSeconds: 1 | |||
| periodSeconds: 10 | |||
| successThreshold: 1 | |||
| failureThreshold: 3 | |||
| terminationMessagePath: "/dev/termination-log" | |||
| terminationMessagePolicy: File | |||
| imagePullPolicy: IfNotPresent | |||
| securityContext: | |||
| capabilities: {} | |||
| privileged: false | |||
| restartPolicy: Always | |||
| terminationGracePeriodSeconds: 30 | |||
| dnsPolicy: ClusterFirst | |||
| securityContext: {} | |||
| schedulerName: default-scheduler | |||
| - kind: PersistentVolumeClaim | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| labels: | |||
| app: "${NAME}-persistent" | |||
| template: "${NAME}-persistent-template" | |||
| spec: | |||
| accessModes: | |||
| - ReadWriteOnce | |||
| resources: | |||
| requests: | |||
| storage: "${PERSISTENT_VOLUME_SIZE}" | |||
| - kind: Secret | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| labels: | |||
| app: "${NAME}" | |||
| data: | |||
| admin-password: "${POSTGRESQL_ADMIN_PASSWORD}" | |||
| database-password: "${POSTGRESQL_PASSWORD}" | |||
| database-user: "${POSTGRESQL_USER}" | |||
| type: Opaque | |||
| - kind: Service | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| labels: | |||
| app: "${NAME}-persistent" | |||
| template: "${NAME}-persistent-template" | |||
| annotations: | |||
| template.openshift.io/expose-uri: postgres://{.spec.clusterIP}:{.spec.ports[?(.name=="postgresql")].port} | |||
| spec: | |||
| ports: | |||
| - name: postgresql | |||
| protocol: TCP | |||
| port: 5432 | |||
| targetPort: 5432 | |||
| selector: | |||
| name: "${NAME}" | |||
| type: ClusterIP | |||
| sessionAffinity: None | |||
| parameters: | |||
| - name: NAME | |||
| displayName: Name | |||
| description: The name assigned to all of the OpenShift resources associated to the PostgreSQL instance. | |||
| required: true | |||
| value: postgresql | |||
| - name: IMAGE_NAMESPACE | |||
| displayName: Image Namespace | |||
| description: The namespace of the OpenShift project containing the imagestream for the application. | |||
| required: true | |||
| value: jag-csb-edivorce-tools | |||
| - name: SOURCE_IMAGE_NAME | |||
| displayName: Source Image Name | |||
| description: The name of the image to use for this resource. | |||
| required: true | |||
| value: postgresql | |||
| - name: TAG_NAME | |||
| displayName: Environment TAG name | |||
| description: The TAG name for this environment, e.g., dev, test, prod | |||
| required: true | |||
| value: dev | |||
| - name: POSTGRESQL_DATABASE_NAME | |||
| displayName: PostgreSQL Database Name | |||
| description: The name of the PostgreSQL database. | |||
| required: true | |||
| generate: expression | |||
| from: "[a-zA-Z_][a-zA-Z0-9_]{10}" | |||
| value: default | |||
| - name: POSTGRESQL_USER | |||
| displayName: PostgreSQL Connection Username | |||
| description: Username for PostgreSQL user that will be used for accessing the database. Needs to be basee64 encoded. | |||
| required: true | |||
| generate: expression | |||
| from: "[a-zA-Z_][a-zA-Z0-9_]{10}" | |||
| - name: POSTGRESQL_PASSWORD | |||
| displayName: PostgreSQL Connection Password | |||
| description: Password for the PostgreSQL connection user. Needs to be basee64 encoded. | |||
| required: true | |||
| generate: expression | |||
| from: "[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]{16}" | |||
| - name: POSTGRESQL_ADMIN_PASSWORD | |||
| displayName: PostgreSQL Admin Password | |||
| description: Password for the 'postgres' PostgreSQL administrative account. Needs to be basee64 encoded. | |||
| required: true | |||
| generate: expression | |||
| from: "[a-zA-Z0-9_~!@#$%^&*()-=<>,.?;:|]{16}" | |||
| - name: MOUNT_PATH | |||
| displayName: Mount Path | |||
| description: The path to mount the persistent volume. | |||
| required: true | |||
| value: "/var/lib/pgsql/data" | |||
| - name: PERSISTENT_VOLUME_SIZE | |||
| displayName: Persistent Volume Size | |||
| description: The size of the persistent volume , e.g. 512Mi, 1Gi, 2Gi. | |||
| required: true | |||
| value: 1Gi | |||
| - name: MEMORY_LIMIT | |||
| displayName: Memory Limit | |||
| description: Maximum amount of memory the container can use. | |||
| required: true | |||
| value: 512Mi | |||
| @ -0,0 +1,45 @@ | |||
| --- | |||
| kind: Template | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}-imagestream-template" | |||
| objects: | |||
| - kind: ImageStream | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| spec: | |||
| tags: | |||
| - name: "${OUTPUT_IMAGE_TAG}" | |||
| annotations: | |||
| from: | |||
| kind: "${SOURCE_IMAGE_KIND}" | |||
| name: "${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG}" | |||
| importPolicy: | |||
| scheduled: true | |||
| parameters: | |||
| - name: NAME | |||
| displayName: Name | |||
| description: The name assigned to all of the frontend objects defined in this template. You should keep this as default unless your know what your doing. | |||
| required: true | |||
| value: weasyprint | |||
| - name: OUTPUT_IMAGE_TAG | |||
| displayName: Output Image Tag | |||
| description: The tag given to the built image. | |||
| required: true | |||
| value: latest | |||
| - name: SOURCE_IMAGE_KIND | |||
| displayName: Source Image Kind | |||
| description: The 'kind' (type) of the source image; typically ImageStreamTag, or DockerImage. | |||
| required: true | |||
| value: DockerImage | |||
| - name: SOURCE_IMAGE_NAME | |||
| displayName: Source Image Name | |||
| description: The name of the source image. | |||
| required: true | |||
| value: aquavitae/weasyprint | |||
| - name: SOURCE_IMAGE_TAG | |||
| displayName: Source Image Tag | |||
| description: The tag of the source image. | |||
| required: true | |||
| value: 'latest' | |||
| @ -0,0 +1,117 @@ | |||
| --- | |||
| kind: Template | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}-deployment-template" | |||
| objects: | |||
| - kind: Service | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| annotations: | |||
| description: Exposes and load balances the application pods. | |||
| spec: | |||
| ports: | |||
| - name: 5001-tcp | |||
| port: 5001 | |||
| targetPort: 5001 | |||
| selector: | |||
| name: "${NAME}" | |||
| - kind: DeploymentConfig | |||
| apiVersion: v1 | |||
| metadata: | |||
| name: "${NAME}" | |||
| annotations: | |||
| description: Defines how to deploy the application server. | |||
| spec: | |||
| strategy: | |||
| type: Rolling | |||
| triggers: | |||
| - type: ImageChange | |||
| imageChangeParams: | |||
| automatic: true | |||
| containerNames: | |||
| - "${NAME}" | |||
| from: | |||
| kind: ImageStreamTag | |||
| namespace: "${IMAGE_NAMESPACE}" | |||
| name: "${SOURCE_IMAGE_NAME}:${TAG_NAME}" | |||
| - type: ConfigChange | |||
| replicas: 1 | |||
| selector: | |||
| name: "${NAME}" | |||
| template: | |||
| metadata: | |||
| name: "${NAME}" | |||
| labels: | |||
| name: "${NAME}" | |||
| spec: | |||
| containers: | |||
| - name: "${NAME}" | |||
| image: " " | |||
| ports: | |||
| - containerPort: 5001 | |||
| protocol: TCP | |||
| readinessProbe: | |||
| timeoutSeconds: 3 | |||
| initialDelaySeconds: 3 | |||
| httpGet: | |||
| path: "/health" | |||
| port: 5001 | |||
| livenessProbe: | |||
| timeoutSeconds: 30 | |||
| initialDelaySeconds: 120 | |||
| periodSeconds: 60 | |||
| httpGet: | |||
| path: "/health" | |||
| port: 5001 | |||
| resources: | |||
| requests: | |||
| cpu: "${CPU_REQUEST}" | |||
| memory: "${MEMORY_REQUEST}" | |||
| limits: | |||
| cpu: "${CPU_LIMIT}" | |||
| memory: "${MEMORY_LIMIT}" | |||
| parameters: | |||
| - name: NAME | |||
| displayName: Name | |||
| description: The name assigned to all of the OpenShift resources associated to the | |||
| server instance. | |||
| required: true | |||
| value: weasyprint | |||
| - name: SOURCE_IMAGE_NAME | |||
| displayName: Source Image Name | |||
| description: The name of the image to use for this resource. | |||
| required: true | |||
| value: weasyprint | |||
| - name: IMAGE_NAMESPACE | |||
| displayName: Image Namespace | |||
| required: true | |||
| description: The namespace of the OpenShift project containing the imagestream for | |||
| the application. | |||
| value: jag-csb-edivorce-tools | |||
| - name: TAG_NAME | |||
| displayName: Environment TAG name | |||
| description: The TAG name for this environment, e.g., dev, test, prod | |||
| required: true | |||
| value: dev | |||
| - name: CPU_LIMIT | |||
| displayName: Resources CPU Limit | |||
| description: The resources CPU limit (in cores) for this build. | |||
| required: true | |||
| value: '2' | |||
| - name: MEMORY_LIMIT | |||
| displayName: Resources Memory Limit | |||
| description: The resources Memory limit (in Mi, Gi, etc) for this build. | |||
| required: true | |||
| value: 1Gi | |||
| - name: CPU_REQUEST | |||
| displayName: Resources CPU Request | |||
| description: The resources CPU request (in cores) for this build. | |||
| required: true | |||
| value: 250m | |||
| - name: MEMORY_REQUEST | |||
| displayName: Resources Memory Request | |||
| description: The resources Memory request (in Mi, Gi, etc) for this build. | |||
| required: true | |||
| value: 512Mi | |||
| @ -0,0 +1,10 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/weasyprint/weasyprint-build.yaml | |||
| #========================================================= | |||
| NAME=weasyprint | |||
| OUTPUT_IMAGE_TAG=latest | |||
| SOURCE_IMAGE_KIND=DockerImage | |||
| SOURCE_IMAGE_NAME=aquavitae/weasyprint | |||
| SOURCE_IMAGE_TAG=latest | |||
| @ -0,0 +1,13 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/weasyprint/weasyprint-deploy.yaml | |||
| #========================================================= | |||
| # NAME=weasyprint | |||
| # SOURCE_IMAGE_NAME=weasyprint | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=dev | |||
| # CPU_LIMIT=2 | |||
| # MEMORY_LIMIT=1Gi | |||
| # CPU_REQUEST=250m | |||
| # MEMORY_REQUEST=512Mi | |||
| @ -0,0 +1,13 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/weasyprint/weasyprint-deploy.yaml | |||
| #========================================================= | |||
| NAME=weasyprint | |||
| SOURCE_IMAGE_NAME=weasyprint | |||
| IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=dev | |||
| CPU_LIMIT=2 | |||
| MEMORY_LIMIT=1Gi | |||
| CPU_REQUEST=250m | |||
| MEMORY_REQUEST=512Mi | |||
| @ -0,0 +1,13 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/weasyprint/weasyprint-deploy.yaml | |||
| #========================================================= | |||
| # NAME=weasyprint | |||
| # SOURCE_IMAGE_NAME=weasyprint | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=prod | |||
| # CPU_LIMIT=2 | |||
| # MEMORY_LIMIT=1Gi | |||
| # CPU_REQUEST=250m | |||
| # MEMORY_REQUEST=512Mi | |||
| @ -0,0 +1,13 @@ | |||
| #========================================================= | |||
| # OpenShift template parameters for: | |||
| # Component: . | |||
| # Template File: templates/weasyprint/weasyprint-deploy.yaml | |||
| #========================================================= | |||
| # NAME=weasyprint | |||
| # SOURCE_IMAGE_NAME=weasyprint | |||
| # IMAGE_NAMESPACE=jag-csb-edivorce-tools | |||
| TAG_NAME=test | |||
| # CPU_LIMIT=2 | |||
| # MEMORY_LIMIT=1Gi | |||
| # CPU_REQUEST=250m | |||
| # MEMORY_REQUEST=512Mi | |||