Skip to content

Commit

Permalink
dynamic JAVA_HOME (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
kriscfoster authored Mar 21, 2024
1 parent 0e7a17e commit f146bf9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker_compose/test_container_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# if JAVA_HOME is not set, just default to /usr (works if /usr/bin/java exists)
if [[ -z "$JAVA_HOME" ]]; then
JAVA_HOME="/usr"
# this is used if JAVA_HOME contains an * (if version changes regularly this can be useful)
elif [[ "$JAVA_HOME" == *"\*"* ]]; then
JAVA_HOME=$(find $JAVA_HOME -maxdepth 1 | head -n 1)
fi

TEST_UBER_JAR=$(find ./ -maxdepth 1 -name '*_uber_jar_deploy.jar')
Expand Down
2 changes: 2 additions & 0 deletions examples/junit-image-test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ services:
test_container:
image: junit-image-test:test_container
entrypoint: ["/busybox/sh", "./test_container_entrypoint.sh"]
environment:
- JAVA_HOME=/usr/

0 comments on commit f146bf9

Please sign in to comment.