-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-build.yml
117 lines (116 loc) · 2.74 KB
/
docker-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# Generalised template for building from Dockerfile in a git repo.
# Includes importing the base image as an imagestream.
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: ${NAME}
objects:
- apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
name: ${BASE_IMAGE_NAME}
spec:
lookupPolicy:
local: false
- apiVersion: v1
kind: ImageStreamTag
lookupPolicy:
local: false
metadata:
name: ${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG}
tag:
annotations: null
from:
kind: DockerImage
name: ${BASE_IMAGE_REPO}${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG}
importPolicy:
scheduled: true
referencePolicy:
type: Source
- kind: ImageStream
apiVersion: v1
metadata:
name: ${NAME}
spec:
lookupPolicy:
local: false
- apiVersion: v1
kind: BuildConfig
metadata:
name: ${NAME}
spec:
resources:
limits:
cpu: ${CPU_LIMIT}
memory: ${MEMORY_LIMIT}
requests:
cpu: ${CPU_REQUEST}
memory: ${MEMORY_REQUEST}
output:
to:
kind: ImageStreamTag
name: "${NAME}:${TAG}"
runPolicy: SerialLatestOnly
source:
contextDir: "${SOURCE_CONTEXT_DIR}"
git:
uri: "${SOURCE_REPOSITORY_URL}"
ref: "${SOURCE_REPOSITORY_REF}"
type: Git
strategy:
dockerStrategy:
from:
kind: ImageStreamTag
name: ${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG}
buildArgs:
- name: GITHUB_AUTH_TOKEN
value: ${GITHUB_AUTH_TOKEN}
- name: SITE_URL
value: ${SITE_URL}
- name: DB_HOST
value: ${DB_HOST}
- name: DB_NAME
value: ${DB_NAME}
- name: DB_PASSWORD
value: ${DB_PASSWORD}
- name: DB_USER
value: ${DB_USER}
type: Docker
parameters:
- name: NAME
required: true
- name: SUFFIX
- name: SOURCE_CONTEXT_DIR
required: true
- name: SOURCE_REPOSITORY_URL
required: true
value: https://github.com/bcgov/moodle.git
- name: SOURCE_REPOSITORY_REF
required: true
- name: TAG
value: "latest"
- name: BASE_IMAGE_REPO
- name: BASE_IMAGE_NAME
required: true
- name: BASE_IMAGE_TAG
required: true
- name: CPU_LIMIT
value: "4"
- name: MEMORY_LIMIT
value: "8Gi"
- name: CPU_REQUEST
value: "2"
- name: MEMORY_REQUEST
value: "8Gi"
- name: GITHUB_AUTH_TOKEN
required: true
- name: SITE_URL
required: false
- name: DB_HOST
required: true
- name: DB_NAME
required: true
- name: DB_PASSWORD
required: true
- name: DB_USER
required: true