Skip to content

Commit 5ff1f77

Browse files
kabicinkabicin
authored andcommitted
Update copyright headers and support SERVER_NAME env
1 parent 63f73eb commit 5ff1f77

File tree

11 files changed

+158
-130
lines changed

11 files changed

+158
-130
lines changed

ga/23.0.0.3/kernel/Dockerfile.ubi.ibmjava8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) Copyright IBM Corporation 2019.
1+
# (C) Copyright IBM Corporation 2019, 2023.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -127,4 +127,4 @@ USER 1001
127127
EXPOSE 9080 9443
128128

129129
ENTRYPOINT ["/opt/ibm/helpers/runtime/docker-server.sh"]
130-
CMD ["/opt/ibm/wlp/bin/server", "run", "defaultServer"]
130+
CMD ["/opt/ibm/wlp/bin/server", "run"]

ga/23.0.0.3/kernel/Dockerfile.ubi.openjdk11

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) Copyright IBM Corporation 2019.
1+
# (C) Copyright IBM Corporation 2019, 2023.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -128,4 +128,4 @@ USER 1001
128128
EXPOSE 9080 9443
129129

130130
ENTRYPOINT ["/opt/ibm/helpers/runtime/docker-server.sh"]
131-
CMD ["/opt/ibm/wlp/bin/server", "run", "defaultServer"]
131+
CMD ["/opt/ibm/wlp/bin/server", "run"]

ga/23.0.0.3/kernel/Dockerfile.ubi.openjdk17

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) Copyright IBM Corporation 2019.
1+
# (C) Copyright IBM Corporation 2019, 2023.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -128,4 +128,4 @@ USER 1001
128128
EXPOSE 9080 9443
129129

130130
ENTRYPOINT ["/opt/ibm/helpers/runtime/docker-server.sh"]
131-
CMD ["/opt/ibm/wlp/bin/server", "run", "defaultServer"]
131+
CMD ["/opt/ibm/wlp/bin/server", "run"]

ga/23.0.0.3/kernel/Dockerfile.ubi.openjdk8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) Copyright IBM Corporation 2019.
1+
# (C) Copyright IBM Corporation 2019, 2023.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -128,4 +128,4 @@ USER 1001
128128
EXPOSE 9080 9443
129129

130130
ENTRYPOINT ["/opt/ibm/helpers/runtime/docker-server.sh"]
131-
CMD ["/opt/ibm/wlp/bin/server", "run", "defaultServer"]
131+
CMD ["/opt/ibm/wlp/bin/server", "run"]

ga/23.0.0.3/kernel/Dockerfile.ubuntu.ibmjava8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) Copyright IBM Corporation 2019.
1+
# (C) Copyright IBM Corporation 2019, 2023.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -126,4 +126,4 @@ USER 1001
126126
EXPOSE 9080 9443
127127

128128
ENTRYPOINT ["/opt/ibm/helpers/runtime/docker-server.sh"]
129-
CMD ["/opt/ibm/wlp/bin/server", "run", "defaultServer"]
129+
CMD ["/opt/ibm/wlp/bin/server", "run"]

ga/23.0.0.3/kernel/Dockerfile.ubuntu.openjdk11

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) Copyright IBM Corporation 2020.
1+
# (C) Copyright IBM Corporation 2020, 2023.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -126,4 +126,4 @@ USER 1001
126126
EXPOSE 9080 9443
127127

128128
ENTRYPOINT ["/opt/ibm/helpers/runtime/docker-server.sh"]
129-
CMD ["/opt/ibm/wlp/bin/server", "run", "defaultServer"]
129+
CMD ["/opt/ibm/wlp/bin/server", "run"]

ga/23.0.0.3/kernel/Dockerfile.ubuntu.openjdk17

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# (C) Copyright IBM Corporation 2020.
1+
# (C) Copyright IBM Corporation 2020, 2023.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -126,4 +126,4 @@ USER 1001
126126
EXPOSE 9080 9443
127127

128128
ENTRYPOINT ["/opt/ibm/helpers/runtime/docker-server.sh"]
129-
CMD ["/opt/ibm/wlp/bin/server", "run", "defaultServer"]
129+
CMD ["/opt/ibm/wlp/bin/server", "run"]
Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
#!/bin/bash
22

3+
OPT_PREFIX="/opt/ibm"
4+
ORIGINAL_WLP_OUTPUT_DIR="$OPT_PREFIX/wlp/output"
5+
ORIGINAL_SERVER_NAME="defaultServer"
6+
IS_KERNEL=false
7+
38
# 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
9+
if [ "$SERVER_NAME" != "$ORIGINAL_SERVER_NAME" ] && [ -d "$OPT_PREFIX/wlp/usr/servers/$ORIGINAL_SERVER_NAME" ]; then
510
# Create new Liberty server
6-
/opt/ibm/wlp/bin/server create >/tmp/serverOutput
11+
if $IS_KERNEL; then
12+
$OPT_PREFIX/wlp/bin/server create >/tmp/serverOutput
13+
else
14+
$OPT_PREFIX/wlp/bin/server create --template=javaee8 >/tmp/serverOutput
15+
fi
716
rc=$?
817
if [ $rc -ne 0 ]; then
918
cat /tmp/serverOutput
@@ -13,42 +22,40 @@ if [ "$SERVER_NAME" != "defaultServer" ] && [ -d "/opt/ibm/wlp/usr/servers/defau
1322
rm /tmp/serverOutput
1423

1524
# Verify server creation
16-
if [ ! -d "/opt/ibm/wlp/usr/servers/$SERVER_NAME" ]; then
25+
if [ ! -d "$OPT_PREFIX/wlp/usr/servers/$SERVER_NAME" ]; then
1726
echo "The server name contains a character that is not valid."
1827
exit 1
1928
fi
20-
chmod -R g+w /opt/ibm/wlp/usr/servers/$SERVER_NAME
29+
chmod -R g+w $OPT_PREFIX/wlp/usr/servers/$SERVER_NAME
2130

2231
# Delete old symlinks
23-
rm /opt/ibm/links/output
24-
rm /opt/ibm/links/config
32+
rm $OPT_PREFIX/links/output
33+
rm $OPT_PREFIX/links/config
2534

2635
# 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
36+
SERVER_OUTPUT_DIR=$WLP_OUTPUT_DIR/$SERVER_NAME
37+
ORIGINAL_SERVER_OUTPUT_DIR=$ORIGINAL_WLP_OUTPUT_DIR/$ORIGINAL_SERVER_NAME
38+
mkdir -p $SERVER_OUTPUT_DIR
39+
ln -s $SERVER_OUTPUT_DIR $OPT_PREFIX/links/output
40+
41+
# Copy old /output folder contents
42+
cp -r $ORIGINAL_SERVER_OUTPUT_DIR/. $SERVER_OUTPUT_DIR/ 2>/dev/null
43+
rm -rf $ORIGINAL_SERVER_OUTPUT_DIR
44+
chmod -R g+rw $SERVER_OUTPUT_DIR
45+
setfacl -R -dm g:root:rw $SERVER_OUTPUT_DIR
46+
47+
# Add new server symlink and copy over old /config folder contents
48+
cp -r $OPT_PREFIX/wlp/usr/servers/$ORIGINAL_SERVER_NAME/. $OPT_PREFIX/wlp/usr/servers/$SERVER_NAME/ 2>/dev/null
49+
ln -s $OPT_PREFIX/wlp/usr/servers/$SERVER_NAME $OPT_PREFIX/links/config
4650
mkdir -p /config/configDropins/defaults
4751
mkdir -p /config/configDropins/overrides
48-
chmod -R g+w /config
49-
50-
rm -rf /opt/ibm/wlp/usr/servers/defaultServer
52+
if $IS_KERNEL; then
53+
mkdir -p /config/dropins
54+
mkdir -p /config/apps
55+
fi
56+
chmod -R g+rw /config
57+
setfacl -R -dm g:root:rw /config
58+
rm -rf $OPT_PREFIX/wlp/usr/servers/$ORIGINAL_SERVER_NAME
5159
fi
5260

53-
echo "configure-liberty.sh script has been run" > /opt/ibm/wlp/configure-liberty.log
5461
exit 0
Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
#!/bin/bash
22

3+
OPT_PREFIX="/opt/ibm"
4+
ORIGINAL_WLP_OUTPUT_DIR="$OPT_PREFIX/wlp/output"
5+
ORIGINAL_SERVER_NAME="defaultServer"
6+
IS_KERNEL=false
7+
38
# 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
9+
if [ "$SERVER_NAME" != "$ORIGINAL_SERVER_NAME" ] && [ -d "$OPT_PREFIX/wlp/usr/servers/$ORIGINAL_SERVER_NAME" ]; then
510
# Create new Liberty server
6-
/opt/ibm/wlp/bin/server create >/tmp/serverOutput
11+
if $IS_KERNEL; then
12+
$OPT_PREFIX/wlp/bin/server create >/tmp/serverOutput
13+
else
14+
$OPT_PREFIX/wlp/bin/server create --template=javaee8 >/tmp/serverOutput
15+
fi
716
rc=$?
817
if [ $rc -ne 0 ]; then
918
cat /tmp/serverOutput
@@ -13,42 +22,40 @@ if [ "$SERVER_NAME" != "defaultServer" ] && [ -d "/opt/ibm/wlp/usr/servers/defau
1322
rm /tmp/serverOutput
1423

1524
# Verify server creation
16-
if [ ! -d "/opt/ibm/wlp/usr/servers/$SERVER_NAME" ]; then
25+
if [ ! -d "$OPT_PREFIX/wlp/usr/servers/$SERVER_NAME" ]; then
1726
echo "The server name contains a character that is not valid."
1827
exit 1
1928
fi
20-
chmod -R g+w /opt/ibm/wlp/usr/servers/$SERVER_NAME
29+
chmod -R g+w $OPT_PREFIX/wlp/usr/servers/$SERVER_NAME
2130

2231
# Delete old symlinks
23-
rm /opt/ibm/links/output
24-
rm /opt/ibm/links/config
32+
rm $OPT_PREFIX/links/output
33+
rm $OPT_PREFIX/links/config
2534

2635
# 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
36+
SERVER_OUTPUT_DIR=$WLP_OUTPUT_DIR/$SERVER_NAME
37+
ORIGINAL_SERVER_OUTPUT_DIR=$ORIGINAL_WLP_OUTPUT_DIR/$ORIGINAL_SERVER_NAME
38+
mkdir -p $SERVER_OUTPUT_DIR
39+
ln -s $SERVER_OUTPUT_DIR $OPT_PREFIX/links/output
40+
41+
# Copy old /output folder contents
42+
cp -r $ORIGINAL_SERVER_OUTPUT_DIR/. $SERVER_OUTPUT_DIR/ 2>/dev/null
43+
rm -rf $ORIGINAL_SERVER_OUTPUT_DIR
44+
chmod -R g+rw $SERVER_OUTPUT_DIR
45+
setfacl -R -dm g:root:rw $SERVER_OUTPUT_DIR
46+
47+
# Add new server symlink and copy over old /config folder contents
48+
cp -r $OPT_PREFIX/wlp/usr/servers/$ORIGINAL_SERVER_NAME/. $OPT_PREFIX/wlp/usr/servers/$SERVER_NAME/ 2>/dev/null
49+
ln -s $OPT_PREFIX/wlp/usr/servers/$SERVER_NAME $OPT_PREFIX/links/config
4650
mkdir -p /config/configDropins/defaults
4751
mkdir -p /config/configDropins/overrides
48-
chmod -R g+w /config
49-
50-
rm -rf /opt/ibm/wlp/usr/servers/defaultServer
52+
if $IS_KERNEL; then
53+
mkdir -p /config/dropins
54+
mkdir -p /config/apps
55+
fi
56+
chmod -R g+rw /config
57+
setfacl -R -dm g:root:rw /config
58+
rm -rf $OPT_PREFIX/wlp/usr/servers/$ORIGINAL_SERVER_NAME
5159
fi
5260

53-
echo "configure-liberty.sh script has been run" > /opt/ibm/wlp/configure-liberty.log
5461
exit 0
Lines changed: 36 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
#!/bin/bash
22

3+
OPT_PREFIX="/opt/ibm"
4+
ORIGINAL_WLP_OUTPUT_DIR="$OPT_PREFIX/wlp/output"
5+
ORIGINAL_SERVER_NAME="defaultServer"
6+
IS_KERNEL=false
7+
38
# 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
9+
if [ "$SERVER_NAME" != "$ORIGINAL_SERVER_NAME" ] && [ -d "$OPT_PREFIX/wlp/usr/servers/$ORIGINAL_SERVER_NAME" ]; then
510
# Create new Liberty server
6-
/opt/ibm/wlp/bin/server create >/tmp/serverOutput
11+
if $IS_KERNEL; then
12+
$OPT_PREFIX/wlp/bin/server create >/tmp/serverOutput
13+
else
14+
$OPT_PREFIX/wlp/bin/server create --template=javaee8 >/tmp/serverOutput
15+
fi
716
rc=$?
817
if [ $rc -ne 0 ]; then
918
cat /tmp/serverOutput
@@ -13,42 +22,40 @@ if [ "$SERVER_NAME" != "defaultServer" ] && [ -d "/opt/ibm/wlp/usr/servers/defau
1322
rm /tmp/serverOutput
1423

1524
# Verify server creation
16-
if [ ! -d "/opt/ibm/wlp/usr/servers/$SERVER_NAME" ]; then
25+
if [ ! -d "$OPT_PREFIX/wlp/usr/servers/$SERVER_NAME" ]; then
1726
echo "The server name contains a character that is not valid."
1827
exit 1
1928
fi
20-
chmod -R g+w /opt/ibm/wlp/usr/servers/$SERVER_NAME
29+
chmod -R g+w $OPT_PREFIX/wlp/usr/servers/$SERVER_NAME
2130

2231
# Delete old symlinks
23-
rm /opt/ibm/links/output
24-
rm /opt/ibm/links/config
32+
rm $OPT_PREFIX/links/output
33+
rm $OPT_PREFIX/links/config
2534

2635
# 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
36+
SERVER_OUTPUT_DIR=$WLP_OUTPUT_DIR/$SERVER_NAME
37+
ORIGINAL_SERVER_OUTPUT_DIR=$ORIGINAL_WLP_OUTPUT_DIR/$ORIGINAL_SERVER_NAME
38+
mkdir -p $SERVER_OUTPUT_DIR
39+
ln -s $SERVER_OUTPUT_DIR $OPT_PREFIX/links/output
40+
41+
# Copy old /output folder contents
42+
cp -r $ORIGINAL_SERVER_OUTPUT_DIR/. $SERVER_OUTPUT_DIR/ 2>/dev/null
43+
rm -rf $ORIGINAL_SERVER_OUTPUT_DIR
44+
chmod -R g+rw $SERVER_OUTPUT_DIR
45+
setfacl -R -dm g:root:rw $SERVER_OUTPUT_DIR
46+
47+
# Add new server symlink and copy over old /config folder contents
48+
cp -r $OPT_PREFIX/wlp/usr/servers/$ORIGINAL_SERVER_NAME/. $OPT_PREFIX/wlp/usr/servers/$SERVER_NAME/ 2>/dev/null
49+
ln -s $OPT_PREFIX/wlp/usr/servers/$SERVER_NAME $OPT_PREFIX/links/config
4650
mkdir -p /config/configDropins/defaults
4751
mkdir -p /config/configDropins/overrides
48-
chmod -R g+w /config
49-
50-
rm -rf /opt/ibm/wlp/usr/servers/defaultServer
52+
if $IS_KERNEL; then
53+
mkdir -p /config/dropins
54+
mkdir -p /config/apps
55+
fi
56+
chmod -R g+rw /config
57+
setfacl -R -dm g:root:rw /config
58+
rm -rf $OPT_PREFIX/wlp/usr/servers/$ORIGINAL_SERVER_NAME
5159
fi
5260

53-
echo "configure-liberty.sh script has been run" > /opt/ibm/wlp/configure-liberty.log
5461
exit 0

0 commit comments

Comments
 (0)