forked from linux-system-roles/test-harness
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openshift-objects.yml
138 lines (138 loc) · 4.46 KB
/
openshift-objects.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
apiVersion: v1
kind: List
items:
- kind: ServiceAccount
apiVersion: v1
metadata:
name: tester
- kind: ImageStream
apiVersion: v1
metadata:
name: {{ __test_harness_imgstream_name | d("linux-system-roles") }}
spec:
tags:
- name: latest
from:
kind: DockerImage
name: {{ __test_harness_imgstream_name | d("linux-system-roles") }}:latest
- name: staging
from:
kind: DockerImage
name: {{ __test_harness_imgstream_name | d("linux-system-roles") }}:staging
- kind: BuildConfig
apiVersion: v1
metadata:
name: {{ __test_harness_bc | d("linux-system-roles") }}
spec:
output:
to:
kind: ImageStreamTag
name: {{ __test_harness_imgstream_name | d("linux-system-roles") }}:{{
"latest" if test_harness_git_branch | d("production") == "production"
else "staging"
}}
resources: {}
source:
git:
uri: https://github.com/linux-system-roles/test-harness
ref: {{ test_harness_git_branch | d("production") }}
type: Git
{% if __test_harness_build_config_files %}
configMaps:
- configMap:
name: {{ __test_harness_bc | d("linux-system-roles") }}-buildcm
{% endif %}
dockerfile: |
{{
lookup('file', __test_harness_dockerfile) |
regex_replace('^FROM .*\n', 'FROM ' ~ __test_harness_dockerfile_from) |
replace('#EXTRAPRETESTER', __test_harness_dockerfile_pre_tester | join('\n')) |
replace('#EXTRAPOST', __test_harness_dockerfile_post | join('\n')) |
indent(width=10,blank=True)
}}
strategy:
dockerStrategy: {}
triggers:
- type: ConfigChange
- type: ImageChange
- kind: DeploymentConfig
apiVersion: v1
metadata:
name: {{ __test_harness_dc | d("linux-system-roles") }}
spec:
replicas: {{ __test_harness_deploy_replicas | d("8") | int }}
selector:
name: {{ __test_harness_dc | d("linux-system-roles") }}
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- {{ __test_harness_dc | d("linux-system-roles") }}
from:
kind: ImageStreamTag
name: {{ __test_harness_imgstream_name | d("linux-system-roles") }}:{{
"latest" if test_harness_git_branch | d("production") == "production"
else "staging"
}}
strategy:
type: Rolling
template:
metadata:
labels:
name: {{ __test_harness_dc | d("linux-system-roles") }}
spec:
serviceAccountName: tester
restartPolicy: Always
{% if test_harness_need_node_selector | d(false) %}
nodeSelector: {{ test_harness_node_selector | to_json }}
{% endif %}
securityContext:
{% if __test_harness_run_as_root | d(false) %}
runAsUser: 0
{% else %}
runAsUser: 1000
fsGroup: 1000
{% endif %}
containers:
- name: {{ __test_harness_dc | d("linux-system-roles") }}
image: {{ __test_harness_imgstream_name | d("linux-system-roles") }}:{{
"latest" if test_harness_git_branch | d("production") == "production"
else "staging"
}}
{% if __test_harness_deploy_env %}
env:
{% for key,value in __test_harness_deploy_env.items() %}
- name: {{ key }}
value: "{{ value }}"
{% endfor %}
{% endif %}
volumeMounts:
- name: secrets
mountPath: /secrets
readOnly: true
- name: config
mountPath: /config
readOnly: true
- name: cache
mountPath: /cache
{% if __test_harness_run_as_root | d(false) %}
securityContext:
privileged: true
{% endif %}
volumes:
- name: secrets
secret:
secretName: {{ __test_harness_secret_name }}
{% if __test_harness_run_as_root | d(false) %}
defaultMode: 256
{% else %}
defaultMode: 288
{% endif %}
- name: config
configMap:
name: {{ __test_harness_cm_name }}
defaultMode: 420
- name: cache
emptyDir: