Skip to content

Commit d639567

Browse files
committed
Move defaultServer name change to new releases
1 parent 20b4c4b commit d639567

File tree

16 files changed

+166
-270
lines changed

16 files changed

+166
-270
lines changed

ga/22.0.0.12/kernel/helpers/build/configure.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ fi
2727
set -Eeox pipefail
2828

2929
function main() {
30+
if [ "$FEATURES_INSTALLED" == "false" ]; then
31+
# Resolve liberty server symlinks and creation for server name changes
32+
/opt/ibm/helpers/build/configure-liberty.sh
33+
if [ $? -ne 0 ]; then
34+
exit
35+
fi
36+
fi
37+
3038
##Define variables for XML snippets source and target paths
3139
WLP_INSTALL_DIR=/opt/ibm/wlp
3240
SHARED_CONFIG_DIR=${WLP_INSTALL_DIR}/usr/shared/config
@@ -143,10 +151,10 @@ function main() {
143151
# Install needed features
144152
if [ "$FEATURE_REPO_URL" ]; then
145153
curl -k --fail $FEATURE_REPO_URL > /tmp/repo.zip
146-
installUtility install --acceptLicense defaultServer --from=/tmp/repo.zip || rc=$?; if [ $rc -ne 22 ]; then exit $rc; fi
154+
installUtility install --acceptLicense $SERVER_NAME --from=/tmp/repo.zip || rc=$?; if [ $rc -ne 22 ]; then exit $rc; fi
147155
rm -rf /tmp/repo.zip
148156
else
149-
installUtility install --acceptLicense defaultServer || rc=$?; if [ $rc -ne 22 ]; then exit $rc; fi
157+
installUtility install --acceptLicense $SERVER_NAME || rc=$?; if [ $rc -ne 22 ]; then exit $rc; fi
150158
fi
151159
fi
152160

ga/22.0.0.12/kernel/helpers/build/features.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ fi
1818

1919
set -Eeox pipefail
2020

21+
# Resolve liberty server symlinks and creation for server name changes
22+
/opt/ibm/helpers/build/configure-liberty.sh
23+
if [ $? -ne 0 ]; then
24+
exit
25+
fi
26+
2127
##Define variables for XML snippets source and target paths
2228
SNIPPETS_SOURCE=/opt/ibm/helpers/build/configuration_snippets
2329
SNIPPETS_TARGET=/config/configDropins/overrides
@@ -42,7 +48,7 @@ if [ "$SSL" == "true" ] || [ "$TLS" == "true" ]; then
4248
fi
4349

4450
# Install necessary features using featureUtility
45-
featureUtility installServerFeatures --acceptLicense defaultServer --noCache
51+
featureUtility installServerFeatures --acceptLicense $SERVER_NAME --noCache
4652
find /opt/ibm/wlp/lib /opt/ibm/wlp/bin ! -perm -g=rw -print0 | xargs -0 -r chmod g+rw
4753

4854
echo "features.sh script has been run" > /logs/features.log

ga/22.0.0.12/kernel/helpers/runtime/docker-server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function importKeyCert() {
8585
}
8686

8787
# Resolve liberty server symlinks and creation for server name changes
88-
/opt/ibm/helpers/runtime/configure-liberty.sh
88+
/opt/ibm/helpers/build/configure-liberty.sh
8989
if [ $? -ne 0 ]; then
9090
exit
9191
fi

ga/22.0.0.8/kernel/helpers/build/configure.sh

Lines changed: 0 additions & 156 deletions
This file was deleted.

ga/22.0.0.8/kernel/helpers/build/features.sh

Lines changed: 0 additions & 52 deletions
This file was deleted.

ga/23.0.0.3/kernel/helpers/build/configure.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ fi
2727
set -Eeox pipefail
2828

2929
function main() {
30+
if [ "$FEATURES_INSTALLED" == "false" ]; then
31+
# Resolve liberty server symlinks and creation for server name changes
32+
/opt/ibm/helpers/build/configure-liberty.sh
33+
if [ $? -ne 0 ]; then
34+
exit
35+
fi
36+
fi
37+
3038
##Define variables for XML snippets source and target paths
3139
WLP_INSTALL_DIR=/opt/ibm/wlp
3240
SHARED_CONFIG_DIR=${WLP_INSTALL_DIR}/usr/shared/config
@@ -143,10 +151,10 @@ function main() {
143151
# Install needed features
144152
if [ "$FEATURE_REPO_URL" ]; then
145153
curl -k --fail $FEATURE_REPO_URL > /tmp/repo.zip
146-
installUtility install --acceptLicense defaultServer --from=/tmp/repo.zip || rc=$?; if [ $rc -ne 22 ]; then exit $rc; fi
154+
installUtility install --acceptLicense $SERVER_NAME --from=/tmp/repo.zip || rc=$?; if [ $rc -ne 22 ]; then exit $rc; fi
147155
rm -rf /tmp/repo.zip
148156
else
149-
installUtility install --acceptLicense defaultServer || rc=$?; if [ $rc -ne 22 ]; then exit $rc; fi
157+
installUtility install --acceptLicense $SERVER_NAME || rc=$?; if [ $rc -ne 22 ]; then exit $rc; fi
150158
fi
151159
fi
152160

ga/23.0.0.3/kernel/helpers/build/features.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ fi
1818

1919
set -Eeox pipefail
2020

21+
# Resolve liberty server symlinks and creation for server name changes
22+
/opt/ibm/helpers/build/configure-liberty.sh
23+
if [ $? -ne 0 ]; then
24+
exit
25+
fi
26+
2127
##Define variables for XML snippets source and target paths
2228
SNIPPETS_SOURCE=/opt/ibm/helpers/build/configuration_snippets
2329
SNIPPETS_TARGET=/config/configDropins/overrides
@@ -42,7 +48,7 @@ if [ "$SSL" == "true" ] || [ "$TLS" == "true" ]; then
4248
fi
4349

4450
# Install necessary features using featureUtility
45-
featureUtility installServerFeatures --acceptLicense defaultServer --noCache
51+
featureUtility installServerFeatures --acceptLicense $SERVER_NAME --noCache
4652
find /opt/ibm/wlp/lib /opt/ibm/wlp/bin ! -perm -g=rw -print0 | xargs -0 -r chmod g+rw
4753

4854
echo "features.sh script has been run" > /logs/features.log
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
# If the Liberty server name is not defaultServer and defaultServer still exists migrate the contents
4+
if [ "$SERVER_NAME" != "defaultServer" ] && [ -d "/opt/ibm/wlp/usr/servers/defaultServer" ]; then
5+
# Create new Liberty server
6+
/opt/ibm/wlp/bin/server create >/tmp/serverOutput
7+
rc=$?
8+
if [ $rc -ne 0 ]; then
9+
cat /tmp/serverOutput
10+
rm /tmp/serverOutput
11+
exit $rc
12+
fi
13+
rm /tmp/serverOutput
14+
15+
# Verify server creation
16+
if [ ! -d "/opt/ibm/wlp/usr/servers/$SERVER_NAME" ]; then
17+
echo "The server name contains a character that is not valid."
18+
exit 1
19+
fi
20+
chmod -R g+w /opt/ibm/wlp/usr/servers/$SERVER_NAME
21+
22+
# Delete old symlinks
23+
rm /opt/ibm/links/output
24+
rm /opt/ibm/links/config
25+
26+
# Add new output folder symlink and resolve group write permissions
27+
mkdir -p $WLP_OUTPUT_DIR/$SERVER_NAME
28+
ln -s $WLP_OUTPUT_DIR/$SERVER_NAME /opt/ibm/links/output
29+
chmod g+w $WLP_OUTPUT_DIR/$SERVER_NAME
30+
mkdir -p $WLP_OUTPUT_DIR/$SERVER_NAME/resources
31+
mkdir -p $WLP_OUTPUT_DIR/$SERVER_NAME/workarea
32+
mkdir -p $WLP_OUTPUT_DIR/$SERVER_NAME/logs
33+
chmod -R g+w $WLP_OUTPUT_DIR/$SERVER_NAME/workarea
34+
chmod -R g+w,o-rwx $WLP_OUTPUT_DIR/$SERVER_NAME/resources
35+
chmod -R g+w,o-rwx $WLP_OUTPUT_DIR/$SERVER_NAME/logs
36+
37+
# Hand over the SCC
38+
if [ "$OPENJ9_SCC" = "true" ] && [ -d "/opt/ibm/wlp/output/defaultServer/.classCache" ]; then
39+
mv /opt/ibm/wlp/output/defaultServer/.classCache $WLP_OUTPUT_DIR/$SERVER_NAME/
40+
fi
41+
rm -rf /opt/ibm/wlp/output/defaultServer
42+
43+
# Add new server symlink and populate folder
44+
mv /opt/ibm/wlp/usr/servers/defaultServer/* /opt/ibm/wlp/usr/servers/$SERVER_NAME/
45+
ln -s /opt/ibm/wlp/usr/servers/$SERVER_NAME /opt/ibm/links/config
46+
mkdir -p /config/configDropins/defaults
47+
mkdir -p /config/configDropins/overrides
48+
chmod -R g+w /config
49+
50+
rm -rf /opt/ibm/wlp/usr/servers/defaultServer
51+
fi
52+
53+
echo "configure-liberty.sh script has been run" > /opt/ibm/wlp/configure-liberty.log
54+
exit 0

0 commit comments

Comments
 (0)