Skip to content

Commit bd0464e

Browse files
author
rwinieski
authored
Merge pull request #50 from marklogic/feature/CLD-646
Add App-Services App-server creation
2 parents c416bc5 + 744fea8 commit bd0464e

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

charts/templates/statefulset.yaml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,21 @@ spec:
5151
exit 0
5252
fi
5353
log "Info: [initContainer] Group $MARKLOGIC_GROUP does not exist, configuring group $MARKLOGIC_GROUP on the MarkLogic cluster."
54-
for i in $(seq 1 5); do
55-
res_code=`curl --anyauth --user ${MARKLOGIC_ADMIN_USERNAME}:${MARKLOGIC_ADMIN_PASSWORD} -m 20 -s -w '%{http_code}' -X POST -d "${GROUP_CFG}" -H "Content-type: application/json" http://${MARKLOGIC_BOOTSTRAP_HOST}:8002/manage/v2/groups`
56-
if [[ ${res_code} -eq 201 ]]; then
57-
log "Info: [initContainer] Successfully configured group $MARKLOGIC_GROUP on the MarkLogic cluster."
58-
break
59-
else
60-
log "Info: [initContainer] Configure group $MARKLOGIC_GROUP retry attempt $i "
61-
log "Info: [initContainer] Expected response code 202, got $res_code"
62-
sleep 10s
63-
fi
64-
[ $i -eq 5 ] && exit 1
65-
done
54+
res_code=`curl --retry 5 --retry-all-errors --retry-max-time 60 --anyauth --user ${MARKLOGIC_ADMIN_USERNAME}:${MARKLOGIC_ADMIN_PASSWORD} -m 20 -s -w '%{http_code}' -X POST -d "${GROUP_CFG}" -H "Content-type: application/json" http://${MARKLOGIC_BOOTSTRAP_HOST}:8002/manage/v2/groups`
55+
if [[ ${res_code} -eq 201 ]]; then
56+
log "Info: [initContainer] Successfully configured group $MARKLOGIC_GROUP on the MarkLogic cluster."
57+
else
58+
log "Info: [initContainer] Expected response code 201, got $res_code"
59+
exit 1
60+
fi
61+
log "Info: [initContainer] Group $MARKLOGIC_GROUP has been created, configuring App-server App-Services in group $MARKLOGIC_GROUP on the MarkLogic cluster."
62+
res_code=`curl --retry 5 --retry-all-errors --retry-max-time 60 --anyauth --user ${MARKLOGIC_ADMIN_USERNAME}:${MARKLOGIC_ADMIN_PASSWORD} -m 20 -s -w '%{http_code}' -X POST -d '{"server-name":"App-Services", "root":"/", "port":8000,"modules-database":"Modules", "content-database":"Documents", "error-handler":"/MarkLogic/rest-api/8000-error-handler.xqy", "url-rewriter":"/MarkLogic/rest-api/8000-rewriter.xml"}' -H "Content-type: application/json" "http://${MARKLOGIC_BOOTSTRAP_HOST}:8002/manage/v2/servers?group-id=${MARKLOGIC_GROUP}&server-type=http"`
63+
if [[ ${res_code} -eq 201 ]]; then
64+
log "Info: [initContainer] Successfully configured App-server App-Services into group $MARKLOGIC_GROUP on the MarkLogic cluster."
65+
else
66+
log "Info: [initContainer] Expected response code 201, got $res_code"
67+
exit 1
68+
fi
6669
env:
6770
- name: MARKLOGIC_GROUP
6871
value: {{ .Values.group.name }}

0 commit comments

Comments
 (0)