Skip to content

Commit

Permalink
created JETTY_START variable
Browse files Browse the repository at this point in the history
  • Loading branch information
gregw committed Oct 4, 2017
1 parent 1bacfe7 commit 4d6cb91
Show file tree
Hide file tree
Showing 14 changed files with 147 additions and 91 deletions.
27 changes: 16 additions & 11 deletions 9.2-jre7/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then
TMPDIR=/tmp/jetty
mkdir $TMPDIR 2>/dev/null
fi

if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi

case "$JAVA_OPTIONS" in
*-Djava.io.tmpdir=*) ;;
*) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;;
Expand Down Expand Up @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then
EOWARN
fi

if [ -f $JETTY_BASE/jetty.start ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then
if [ -f $JETTY_START ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then
cat >&2 <<- 'EOWARN'
********************************************************************
WARNING: The $JETTY_BASE/start.d directory has been modified since
the $JETTY_BASE/jetty.start files was generated. Either delete
the $JETTY_BASE/jetty.start file or re-run
/generate-jetty.start.sh
the $JETTY_START files was generated. Either delete
the $JETTY_START file or re-run
/generate-jetty.start.sh
from a Dockerfile
********************************************************************
EOWARN
fi
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start
set -- $(cat $JETTY_BASE/jetty.start)
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START
set -- $(cat $JETTY_START)
else
# Do a jetty dry run to set the final command
"$@" --dry-run > $JETTY_BASE/jetty.start
if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then
"$@" --dry-run > $JETTY_START
if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then
# command was more than a dry-run
cat $JETTY_BASE/jetty.start \
cat $JETTY_START \
| awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \
| egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration '
exit
fi
set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start)
set -- $(sed 's/\\$//' $JETTY_START)
fi
fi

Expand Down
7 changes: 5 additions & 2 deletions 9.2-jre7/generate-jetty-start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh

rm -f $JETTY_BASE/jetty.start
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start
if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi
rm -f $JETTY_START
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START
27 changes: 16 additions & 11 deletions 9.2-jre8/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then
TMPDIR=/tmp/jetty
mkdir $TMPDIR 2>/dev/null
fi

if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi

case "$JAVA_OPTIONS" in
*-Djava.io.tmpdir=*) ;;
*) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;;
Expand Down Expand Up @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then
EOWARN
fi

if [ -f $JETTY_BASE/jetty.start ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then
if [ -f $JETTY_START ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then
cat >&2 <<- 'EOWARN'
********************************************************************
WARNING: The $JETTY_BASE/start.d directory has been modified since
the $JETTY_BASE/jetty.start files was generated. Either delete
the $JETTY_BASE/jetty.start file or re-run
/generate-jetty.start.sh
the $JETTY_START files was generated. Either delete
the $JETTY_START file or re-run
/generate-jetty.start.sh
from a Dockerfile
********************************************************************
EOWARN
fi
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start
set -- $(cat $JETTY_BASE/jetty.start)
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START
set -- $(cat $JETTY_START)
else
# Do a jetty dry run to set the final command
"$@" --dry-run > $JETTY_BASE/jetty.start
if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then
"$@" --dry-run > $JETTY_START
if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then
# command was more than a dry-run
cat $JETTY_BASE/jetty.start \
cat $JETTY_START \
| awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \
| egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration '
exit
fi
set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start)
set -- $(sed 's/\\$//' $JETTY_START)
fi
fi

Expand Down
7 changes: 5 additions & 2 deletions 9.2-jre8/generate-jetty-start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh

rm -f $JETTY_BASE/jetty.start
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start
if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi
rm -f $JETTY_START
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START
27 changes: 16 additions & 11 deletions 9.3-jre8/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then
TMPDIR=/tmp/jetty
mkdir $TMPDIR 2>/dev/null
fi

if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi

case "$JAVA_OPTIONS" in
*-Djava.io.tmpdir=*) ;;
*) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;;
Expand Down Expand Up @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then
EOWARN
fi

if [ -f $JETTY_BASE/jetty.start ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then
if [ -f $JETTY_START ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then
cat >&2 <<- 'EOWARN'
********************************************************************
WARNING: The $JETTY_BASE/start.d directory has been modified since
the $JETTY_BASE/jetty.start files was generated. Either delete
the $JETTY_BASE/jetty.start file or re-run
/generate-jetty.start.sh
the $JETTY_START files was generated. Either delete
the $JETTY_START file or re-run
/generate-jetty.start.sh
from a Dockerfile
********************************************************************
EOWARN
fi
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start
set -- $(cat $JETTY_BASE/jetty.start)
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START
set -- $(cat $JETTY_START)
else
# Do a jetty dry run to set the final command
"$@" --dry-run > $JETTY_BASE/jetty.start
if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then
"$@" --dry-run > $JETTY_START
if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then
# command was more than a dry-run
cat $JETTY_BASE/jetty.start \
cat $JETTY_START \
| awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \
| egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration '
exit
fi
set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start)
set -- $(sed 's/\\$//' $JETTY_START)
fi
fi

Expand Down
7 changes: 5 additions & 2 deletions 9.3-jre8/alpine/generate-jetty-start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh

rm -f $JETTY_BASE/jetty.start
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start
if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi
rm -f $JETTY_START
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START
27 changes: 16 additions & 11 deletions 9.3-jre8/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then
TMPDIR=/tmp/jetty
mkdir $TMPDIR 2>/dev/null
fi

if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi

case "$JAVA_OPTIONS" in
*-Djava.io.tmpdir=*) ;;
*) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;;
Expand Down Expand Up @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then
EOWARN
fi

if [ -f $JETTY_BASE/jetty.start ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then
if [ -f $JETTY_START ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then
cat >&2 <<- 'EOWARN'
********************************************************************
WARNING: The $JETTY_BASE/start.d directory has been modified since
the $JETTY_BASE/jetty.start files was generated. Either delete
the $JETTY_BASE/jetty.start file or re-run
/generate-jetty.start.sh
the $JETTY_START files was generated. Either delete
the $JETTY_START file or re-run
/generate-jetty.start.sh
from a Dockerfile
********************************************************************
EOWARN
fi
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start
set -- $(cat $JETTY_BASE/jetty.start)
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START
set -- $(cat $JETTY_START)
else
# Do a jetty dry run to set the final command
"$@" --dry-run > $JETTY_BASE/jetty.start
if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then
"$@" --dry-run > $JETTY_START
if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then
# command was more than a dry-run
cat $JETTY_BASE/jetty.start \
cat $JETTY_START \
| awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \
| egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration '
exit
fi
set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start)
set -- $(sed 's/\\$//' $JETTY_START)
fi
fi

Expand Down
7 changes: 5 additions & 2 deletions 9.3-jre8/generate-jetty-start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh

rm -f $JETTY_BASE/jetty.start
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start
if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi
rm -f $JETTY_START
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START
27 changes: 16 additions & 11 deletions 9.4-jre8/alpine/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then
TMPDIR=/tmp/jetty
mkdir $TMPDIR 2>/dev/null
fi

if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi

case "$JAVA_OPTIONS" in
*-Djava.io.tmpdir=*) ;;
*) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;;
Expand Down Expand Up @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then
EOWARN
fi

if [ -f $JETTY_BASE/jetty.start ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then
if [ -f $JETTY_START ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then
cat >&2 <<- 'EOWARN'
********************************************************************
WARNING: The $JETTY_BASE/start.d directory has been modified since
the $JETTY_BASE/jetty.start files was generated. Either delete
the $JETTY_BASE/jetty.start file or re-run
/generate-jetty.start.sh
the $JETTY_START files was generated. Either delete
the $JETTY_START file or re-run
/generate-jetty.start.sh
from a Dockerfile
********************************************************************
EOWARN
fi
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start
set -- $(cat $JETTY_BASE/jetty.start)
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START
set -- $(cat $JETTY_START)
else
# Do a jetty dry run to set the final command
"$@" --dry-run > $JETTY_BASE/jetty.start
if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then
"$@" --dry-run > $JETTY_START
if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then
# command was more than a dry-run
cat $JETTY_BASE/jetty.start \
cat $JETTY_START \
| awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \
| egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration '
exit
fi
set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start)
set -- $(sed 's/\\$//' $JETTY_START)
fi
fi

Expand Down
7 changes: 5 additions & 2 deletions 9.4-jre8/alpine/generate-jetty-start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh

rm -f $JETTY_BASE/jetty.start
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start
if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi
rm -f $JETTY_START
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START
27 changes: 16 additions & 11 deletions 9.4-jre8/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ if [ -z "$TMPDIR" ] ; then
TMPDIR=/tmp/jetty
mkdir $TMPDIR 2>/dev/null
fi

if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi

case "$JAVA_OPTIONS" in
*-Djava.io.tmpdir=*) ;;
*) JAVA_OPTIONS="-Djava.io.tmpdir=$TMPDIR $JAVA_OPTIONS" ;;
Expand Down Expand Up @@ -71,31 +76,31 @@ if expr "$*" : 'java .*/start\.jar.*$' >/dev/null ; then
EOWARN
fi

if [ -f $JETTY_BASE/jetty.start ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_BASE/jetty.start ] ; then
if [ -f $JETTY_START ] ; then
if [ $JETTY_BASE/start.d -nt $JETTY_START ] ; then
cat >&2 <<- 'EOWARN'
********************************************************************
WARNING: The $JETTY_BASE/start.d directory has been modified since
the $JETTY_BASE/jetty.start files was generated. Either delete
the $JETTY_BASE/jetty.start file or re-run
/generate-jetty.start.sh
the $JETTY_START files was generated. Either delete
the $JETTY_START file or re-run
/generate-jetty.start.sh
from a Dockerfile
********************************************************************
EOWARN
fi
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start command from \$JETTY_BASE/jetty.start
set -- $(cat $JETTY_BASE/jetty.start)
echo $(date +'%Y-%m-%d %H:%M:%S.000'):INFO:docker-entrypoint:jetty start from $JETTY_START
set -- $(cat $JETTY_START)
else
# Do a jetty dry run to set the final command
"$@" --dry-run > $JETTY_BASE/jetty.start
if [ $(egrep -v '\\$' $JETTY_BASE/jetty.start | wc -l ) -gt 1 ] ; then
"$@" --dry-run > $JETTY_START
if [ $(egrep -v '\\$' $JETTY_START | wc -l ) -gt 1 ] ; then
# command was more than a dry-run
cat $JETTY_BASE/jetty.start \
cat $JETTY_START \
| awk '/\\$/ { printf "%s", substr($0, 1, length($0)-1); next } 1' \
| egrep -v '[^ ]*java .* org\.eclipse\.jetty\.xml\.XmlConfiguration '
exit
fi
set -- $(sed 's/\\$//' $JETTY_BASE/jetty.start)
set -- $(sed 's/\\$//' $JETTY_START)
fi
fi

Expand Down
7 changes: 5 additions & 2 deletions 9.4-jre8/generate-jetty-start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh

rm -f $JETTY_BASE/jetty.start
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_BASE/jetty.start
if [ -z "$JETTY_START" ] ; then
JETTY_START=$JETTY_BASE/jetty.start
fi
rm -f $JETTY_START
/docker-entrypoint.sh --dry-run | sed 's/\\$//' > $JETTY_START
Loading

0 comments on commit 4d6cb91

Please sign in to comment.