You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

115 lines
3.3 KiB

---
kind: Template
apiVersion: v1
metadata:
name: ${NAME}-build-template
annotations:
description: A Django application with a PostgreSQL database
tags: edivorce,python,django,postgresql
iconClass: icon-python
labels:
template: ${NAME}-build-template
objects:
- kind: ImageStream
apiVersion: v1
metadata:
name: "${NAME}"
- kind: BuildConfig
apiVersion: v1
metadata:
name: "${NAME}"
spec:
source:
type: Git
git:
uri: "${GIT_REPO_URL}"
ref: "${GIT_REF}"
contextDir: "${SOURCE_CONTEXT_DIR}"
strategy:
type: Source
sourceStrategy:
from:
kind: ${SOURCE_IMAGE_KIND}
namespace: "${SOURCE_IMAGE_NAMESPACE}"
name: ${SOURCE_IMAGE_NAME}:${SOURCE_IMAGE_TAG}
env:
- name: PIP_INDEX_URL
value: "${PIP_INDEX_URL}"
output:
to:
kind: ImageStreamTag
name: "${NAME}:latest"
triggers:
- type: ImageChange
- type: ConfigChange
postCommit:
script: "./manage.py test"
resources:
limits:
cpu: ${CPU_LIMIT}
memory: ${MEMORY_LIMIT}
requests:
cpu: ${CPU_REQUEST}
memory: ${MEMORY_REQUEST}
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: GIT_REPO_URL
displayName: Git Repository URL
description: The URL of the repository with your application source code.
required: true
value: https://github.com/bcgov/eDivorce
- name: GIT_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.
- name: SOURCE_CONTEXT_DIR
displayName: Context Directory
description: Set this to the relative path to your project if it is not in the root of your repository.
- name: SOURCE_IMAGE_KIND
displayName: Source Image Kind
description: The 'kind' (type) of the source image; typically ImageStreamTag, or DockerImage.
required: true
value: ImageStreamTag
- name: SOURCE_IMAGE_NAMESPACE
displayName: Source Image Namespace
description: The namespace where the source image resides.
required: true
value: openshift
- name: SOURCE_IMAGE_NAME
displayName: Source Image Name
description: The name of the source image.
required: true
value: python
- name: SOURCE_IMAGE_TAG
displayName: Source Image Tag
description: The tag of the source image.
required: true
value: "3.5"
- name: PIP_INDEX_URL
displayName: Custom PyPi Index URL
description: The custom PyPi index URL
value: ''
# ===============================================================================
- name: CPU_REQUEST
displayName: Resources CPU Request
description: The resources CPU request (in cores) for this build.
required: true
value: 10m
- name: CPU_LIMIT
displayName: Resources CPU Limit
description: The resources CPU limit (in cores) for this build.
required: true
value: 750m
- name: MEMORY_REQUEST
displayName: Resources Memory Request
description: The resources Memory request (in Mi, Gi, etc) for this build.
required: true
value: 10Mi
- name: MEMORY_LIMIT
displayName: Resources Memory Limit
description: The resources Memory limit (in Mi, Gi, etc) for this build.
required: true
value: 1000Mi