File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -174,12 +174,28 @@ spec:
174
174
log "[poststart] wait for marklogic server to be ready"
175
175
sleep 5s
176
176
done
177
- sleep 10s
177
+
178
+ # Fetch timestamp before updating group config
179
+ TIMESTAMP=`curl --anyauth http://${MARKLOGIC_BOOTSTRAP_HOST}:8001/admin/v1/timestamp --user ${MARKLOGIC_ADMIN_USERNAME}:${MARKLOGIC_ADMIN_PASSWORD}`
180
+
178
181
GROUP_CFG_TEMPLATE='{"group-name":"%s", "xdqp-ssl-enabled":"%s"}'
179
182
GROUP_CFG=$(printf "$GROUP_CFG_TEMPLATE" "$MARKLOGIC_GROUP" "$XDQP_SSL_ENABLED")
180
183
log "Info: [poststart] Updating group configuration: ${GROUP_CFG}"
181
- curl --anyauth -m 20 -X PUT -H "Content-type: application/json" -d "${GROUP_CFG}" http://${MARKLOGIC_BOOTSTRAP_HOST}:8002/manage/v2/groups/Default/properties --user ${MARKLOGIC_ADMIN_USERNAME}:${MARKLOGIC_ADMIN_PASSWORD}
182
- sleep 2s
184
+ GROUP_RESP_CODE=`curl --retry 5 --retry-max-time 60 -o /dev/null -w "%{http_code}" --anyauth -m 20 -s -X PUT -H "Content-type: application/json" -d "${GROUP_CFG}" http://${MARKLOGIC_BOOTSTRAP_HOST}:8002/manage/v2/groups/Default/properties --user ${MARKLOGIC_ADMIN_USERNAME}:${MARKLOGIC_ADMIN_PASSWORD}`
185
+
186
+ # check if MarkLogic has restarted
187
+ if [[ ${GROUP_RESP_CODE} -eq 202 ]]; then
188
+ log "Info: [poststart] Waiting for MarkLogic to restart."
189
+ LAST_START=`curl --anyauth http://${MARKLOGIC_BOOTSTRAP_HOST}:8001/admin/v1/timestamp --user ${MARKLOGIC_ADMIN_USERNAME}:${MARKLOGIC_ADMIN_PASSWORD}`
190
+ for i in $(seq 1 5); do
191
+ if [ ${TIMESTAMP} == ${LAST_START} ] || [ -z ${LAST_START} ]; then
192
+ sleep 10
193
+ LAST_START=`curl --anyauth http://${MARKLOGIC_BOOTSTRAP_HOST}:8001/admin/v1/timestamp --user ${MARKLOGIC_ADMIN_USERNAME}:${MARKLOGIC_ADMIN_PASSWORD}`
194
+ else
195
+ log "Info: [poststart] MarkLogic has restarted."
196
+ fi
197
+ done
198
+ fi
183
199
fi
184
200
log "Info: [poststart] Poststart Hook Execution Completed"
185
201
{{- end }}
You can’t perform that action at this time.
0 commit comments