-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from xenit-eu/XM2C-105-h2
XM2C-105 remove terminal formatting in echo
- Loading branch information
Showing
1 changed file
with
7 additions
and
9 deletions.
There are no files selected for viewing
16 changes: 7 additions & 9 deletions
16
tomcat-base/src/shared/main/bash/entrypoint/docker-entrypoint.d/89-check-validity.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
#!/bin/bash | ||
|
||
currentDate=$(date +%s) | ||
if [ -z "${BUILD_DATE}" ] | ||
then | ||
1>&2 echo "$(tput -Txterm setaf 3)"'{ "timestamp" : '"$(date -d @$currentDate +"%s")"' ,"severity" : "WARN", "type" : "application","component" : "docker-entrypoint" ,"fullMessage" : "Unable to determine image age: BUILD_DATE is not set"}'"$(tput -Txterm sgr0)" | ||
if [ -z "${BUILD_DATE}" ]; then | ||
echo '{ "timestamp" : '"$(date -d @$currentDate +"%s")"' ,"severity" : "WARN", "type" : "application","component" : "docker-entrypoint" ,"fullMessage" : "Unable to determine image age: BUILD_DATE is not set"}' | ||
else | ||
printf -v buildDate "%.0f\n" "$BUILD_DATE" | ||
timeelapsed=`expr ${currentDate} - ${buildDate}` | ||
if [ $timeelapsed -ge 2592000 ] # 30 days | ||
then | ||
1>&2 echo "$(tput -Txterm setaf 3)"'{ "timestamp" : '"$(date -d @$currentDate +"%s")"' ,"severity" : "WARN", "type" : "application","component" : "docker-entrypoint" , "fullMessage" : "This is an old image: BUILD_DATE='"$(date -d @$BUILD_DATE +"%Y-%m-%d %H:%M:%S")"' and currentDate='"$(date -d @$currentDate +"%Y-%m-%d %H:%M:%S")"'"}'"$(tput -Txterm sgr0)" | ||
fi | ||
printf -v buildDate "%.0f\n" "$BUILD_DATE" | ||
timeelapsed=$(expr ${currentDate} - ${buildDate}) | ||
if [ $timeelapsed -ge 2592000 ]; then # 30 days | ||
echo '{ "timestamp" : '"$(date -d @$currentDate +"%s")"' ,"severity" : "WARN", "type" : "application","component" : "docker-entrypoint" , "fullMessage" : "This is an old image: BUILD_DATE='"$(date -d @$BUILD_DATE +"%Y-%m-%d %H:%M:%S")"' and currentDate='"$(date -d @$currentDate +"%Y-%m-%d %H:%M:%S")"'"}' | ||
fi | ||
fi |