This repository was archived by the owner on Apr 1, 2025. It is now read-only.
File tree 5 files changed +75
-1
lines changed
5 files changed +75
-1
lines changed Original file line number Diff line number Diff line change
1
+ #
2
+ # Defines file to be passed to SQUAD_EXTRA_SETTINGS
3
+ #
4
+ apiVersion : v1
5
+ kind : ConfigMap
6
+ metadata :
7
+ name : qareports-extra-settings
8
+ data :
9
+ extra_settings.py : |-
10
+ # DO NOT CHANGE THIS MANUALLY
11
+
12
+ # Read ldap configuration, if there's any
13
+ try:
14
+ exec(open("/app/linaro_ldap.py").read())
15
+ except (IOError, FileNotFoundError):
16
+ pass
17
+
18
+ # Enable health-check endpoint
19
+ # should enable it in worker as well!
20
+ try:
21
+ import health_check
22
+
23
+ # This is required by RabbitMQ checker
24
+ # ref: https://github.com/KristianOellegaard/django-health-check/blob/d08200dd7c01a8781236856b7b4714a15a8ba286/health_check/contrib/rabbitmq/backends.py
25
+ BROKER_URL = CELERY_BROKER_URL
26
+ HEALTHCHECK_CELERY_PING_TIMEOUT = 5
27
+
28
+ INSTALLED_APPS.append('health_check')
29
+ INSTALLED_APPS.append('health_check.db')
30
+ INSTALLED_APPS.append('health_check.contrib.celery')
31
+ INSTALLED_APPS.append('health_check.contrib.celery_ping')
32
+ INSTALLED_APPS.append('health_check.contrib.s3boto3_storage')
33
+ INSTALLED_APPS.append('health_check.contrib.rabbitmq')
34
+ except ImportError:
35
+ pass
Original file line number Diff line number Diff line change 53
53
configMap :
54
54
name : qareports-local-settings
55
55
56
+ - name : qareports-extra-settings
57
+ configMap :
58
+ name : qareports-extra-settings
59
+
56
60
containers :
57
61
- name : qareports-fetch-worker
58
62
image : squadproject/squad:release
69
73
- secretRef :
70
74
name : qareports-environment
71
75
76
+ # Inject health-check settings
77
+ env :
78
+ - name : SQUAD_EXTRA_SETTINGS
79
+ value : " /app/extra_settings.py"
80
+
72
81
volumeMounts :
73
82
- name : qareports-secret-key
74
83
mountPath : /app/secret.dat
78
87
mountPath : /usr/local/lib/python3.7/dist-packages/squad/local_settings.py
79
88
subPath : local_settings.py
80
89
90
+ - name : qareports-extra-settings
91
+ mountPath : /app/extra_settings.py
92
+ subPath : extra_settings.py
93
+
81
94
resources :
82
95
requests :
83
96
memory : " 4096M"
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ spec:
129
129
# Inject ldap into container
130
130
env :
131
131
- name : SQUAD_EXTRA_SETTINGS
132
- value : " /app/linaro_ldap .py"
132
+ value : " /app/extra_settings .py"
133
133
134
134
volumeMounts :
135
135
- name : qareports-secret-key
@@ -148,6 +148,10 @@ spec:
148
148
mountPath : /usr/local/lib/python3.7/dist-packages/squad/local_settings.py
149
149
subPath : local_settings.py
150
150
151
+ - name : qareports-extra-settings
152
+ mountPath : /app/extra_settings.py
153
+ subPath : extra_settings.py
154
+
151
155
resources :
152
156
requests :
153
157
memory : " 1024M"
@@ -200,5 +204,9 @@ spec:
200
204
configMap :
201
205
name : qareports-local-settings
202
206
207
+ - name : qareports-extra-settings
208
+ configMap :
209
+ name : qareports-extra-settings
210
+
203
211
- name : static-files
204
212
emptyDir : {}
Original file line number Diff line number Diff line change 57
57
configMap :
58
58
name : qareports-local-settings
59
59
60
+ - name : qareports-extra-settings
61
+ configMap :
62
+ name : qareports-extra-settings
63
+
60
64
- name : ssh-folder
61
65
emptyDir : {}
62
66
92
96
- secretRef :
93
97
name : qareports-environment
94
98
99
+ # Inject health-check settings
100
+ env :
101
+ - name : SQUAD_EXTRA_SETTINGS
102
+ value : " /app/extra_settings.py"
103
+
95
104
volumeMounts :
96
105
- name : qareports-secret-key
97
106
mountPath : /app/secret.dat
@@ -101,6 +110,10 @@ spec:
101
110
mountPath : /usr/local/lib/python3.7/dist-packages/squad/local_settings.py
102
111
subPath : local_settings.py
103
112
113
+ - name : qareports-extra-settings
114
+ mountPath : /app/extra_settings.py
115
+ subPath : extra_settings.py
116
+
104
117
- name : ssh-folder
105
118
mountPath : /app/.ssh
106
119
Original file line number Diff line number Diff line change @@ -152,6 +152,11 @@ qareports_update_local_settings(){
152
152
sed " s/%ENVIRONMENT%/${environment} /" k8s/qareports-local-settings.yml | k apply -f -
153
153
}
154
154
155
+ qareports_update_extra_settings (){
156
+ echo " Updating extra_settings.py for $environment "
157
+ k apply -f k8s/qareports-extra-settings.yml
158
+ }
159
+
155
160
qareports_upgrade_squad () {
156
161
echo " Upgraging $environment "
157
162
You can’t perform that action at this time.
0 commit comments