Skip to content

Commit fac1cca

Browse files
committed
Add mp health build arg
Signed-off-by: Adam Wisniewski <[email protected]>
1 parent 0ba8471 commit fac1cca

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

build.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ STACK_IMAGE="${STACK_IMAGE:-openliberty/application-stack:0.4}"
2828
#
2929
# URL at which your outer loop Dockerfile is hosted
3030
#
31-
DEVFILE_DOCKERFILE_LOC="${DEVFILE_DOCKERFILE_LOC:-https://github.com/OpenLiberty/application-stack/releases/download/outer-loop-0.4.1/Dockerfile}"
31+
DEVFILE_DOCKERFILE_LOC="${DEVFILE_DOCKERFILE_LOC:-https://github.com/OpenLiberty/application-stack/releases/download/outer-loop-0.5.0/Dockerfile}"
3232

3333
#
3434
# URL at which your outer loop deploy YAML template is hosted
3535
#
36-
DEVFILE_DEPLOY_YAML_LOC="${DEVFILE_DEPLOY_YAML_LOC:-https://github.com/OpenLiberty/application-stack/releases/download/outer-loop-0.4.1/app-deploy.yaml}"
36+
DEVFILE_DEPLOY_YAML_LOC="${DEVFILE_DEPLOY_YAML_LOC:-https://github.com/OpenLiberty/application-stack/releases/download/outer-loop-0.5.0/app-deploy.yaml}"
3737

3838
# Generates application stack artifacts.
3939
generate() {

templates/outer-loop/Dockerfile

+17-8
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,25 @@ COPY --from=compile --chown=1001:0 /work/config/ /config/
4242

4343
# 2d) Add the microprofile health feature configuration if it is not already defined in the user's configuration.
4444
# This allows k8s to use the deployment's health probes.
45-
COPY --from=compile --chown=1001:0 /stack/ol/config/configDropins/defaults/liberty-stack-mpHealth.xml /config/configDropins/defaults
46-
RUN for FILE in /config/*.xml; do \
47-
if cat $FILE | sed '/<!--.*-->/d' | sed '/<!--/,/-->/d' \
48-
| grep -q '<feature>\s*mpHealth-[0-9]*.[0-9]*\s*</feature>\|<feature>\s*microProfile-[0-9]*.[0-9]*\s*</feature>'; then \
49-
rm /config/configDropins/defaults/liberty-stack-mpHealth.xml; \
45+
RUN mkdir -p /tmp/stack/config/configDropins/defaults
46+
COPY --from=compile --chown=1001:0 /stack/ol/config/configDropins/defaults/ /tmp/stack/config/configDropins/defaults/
47+
48+
ARG ADD_MP_HEALTH=true
49+
RUN if [ "$ADD_MP_HEALTH" = "true" ]; then \
50+
/opt/ol/wlp/bin/server start; \
51+
/opt/ol/wlp/bin/server stop; \
52+
if ! grep "CWWKF0012I" /logs/messages.log | grep -q 'mpHealth-[0-9]*.[0-9]*\|microProfile-[0-9]*.[0-9]*'; then \
53+
echo "Missing mpHealth feature - adding config snippet"; \
54+
cp /tmp/stack/config/configDropins/defaults/liberty-stack-mpHealth.xml /config/configDropins/overrides; \
55+
else \
56+
echo "Found mpHealth feature - not adding config snippet"; \
5057
fi; \
51-
done
58+
rm -rf /logs/*; \
59+
elif [ "$ADD_MP_HEALTH" != "false" ]; then \
60+
echo "Invalid ADD_MP_HEALTH value: $ADD_MP_HEALTH. Valid values are \"true\" | \"false\" "; \
61+
fi
5262

53-
# This Dockerfile uses the Open Liberty "full" image. If this is changed to use the Open Liberty kernel-slim image, uncomment the line below to install all necessary features.
54-
# RUN features.sh
63+
RUN rm -rf /tmp/stack
5564

5665
# 2e) Copy the application binary
5766
COPY --from=compile --chown=1001:0 /work/outer-loop-app/target/*.[ew]ar /config/apps

0 commit comments

Comments
 (0)