Skip to content

Commit 6fe7b99

Browse files
authored
Hide keystore logs (#618)
* Hide keystore logs * Revert ga/latest/kernel/Dockerfile changes
1 parent 689750a commit 6fe7b99

5 files changed

Lines changed: 42 additions & 18 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# (C) Copyright IBM Corporation 2020, 2023.
2+
# (C) Copyright IBM Corporation 2020, 2025.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -20,9 +20,7 @@ else
2020
FEATURES_INSTALLED=false
2121
fi
2222

23-
if [ "$VERBOSE" != "true" ]; then
24-
exec >/dev/null
25-
fi
23+
. /opt/ibm/helpers/build/internal/logger.sh
2624

2725
set -Eeox pipefail
2826

@@ -128,8 +126,10 @@ function main() {
128126
if [ "$SSL" != "false" ] && [ "$TLS" != "false" ]; then
129127
if [ ! -e $keystorePath ]; then
130128
# Generate the keystore.xml
131-
export KEYSTOREPWD=$(openssl rand -base64 32)
129+
hideLogs
130+
KEYSTOREPWD=$(openssl rand -base64 32)
132131
sed "s|REPLACE|$KEYSTOREPWD|g" $SNIPPETS_SOURCE/keystore.xml > $SNIPPETS_TARGET_DEFAULTS/keystore.xml
132+
showLogs
133133
chmod g+w $SNIPPETS_TARGET_DEFAULTS/keystore.xml
134134
fi
135135
fi
@@ -231,4 +231,4 @@ function parseCommaList() {
231231
done
232232
}
233233

234-
main "$@"
234+
main "$@"

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# (C) Copyright IBM Corporation 2023.
2+
# (C) Copyright IBM Corporation 2023, 2025.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -12,9 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
if [ "$VERBOSE" != "true" ]; then
16-
exec >/dev/null
17-
fi
15+
. /opt/ibm/helpers/build/internal/logger.sh
1816

1917
set -Eeox pipefail
2018

ga/latest/kernel/helpers/build/infinispan-client-setup.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# (C) Copyright IBM Corporation 2020.
2+
# (C) Copyright IBM Corporation 2020, 2025.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -12,9 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
if [ "$VERBOSE" != "true" ]; then
16-
exec >/dev/null
17-
fi
15+
. /opt/ibm/helpers/build/internal/logger.sh
1816

1917
set -Eeox pipefail
2018

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
# (C) Copyright IBM Corporation 2025.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
function main() {
17+
if [ "$VERBOSE" != "true" ]; then
18+
exec >/dev/null
19+
fi
20+
}
21+
22+
function hideLogs() {
23+
exec 3>&1 >/dev/null 4>&2 2>/dev/null
24+
}
25+
26+
function showLogs() {
27+
exec 1>&3 3>&- 2>&4 4>&-
28+
}
29+
30+
main

ga/latest/kernel/helpers/build/populate_scc.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# (C) Copyright IBM Corporation 2020, 2024
2+
# (C) Copyright IBM Corporation 2020, 2025.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -12,9 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
if [ "$VERBOSE" != "true" ]; then
16-
exec >/dev/null
17-
fi
15+
. /opt/ibm/helpers/build/internal/logger.sh
1816

1917
set -Eeox pipefail
2018

0 commit comments

Comments
 (0)