From 1eac15c210f2ec360912c8372e0fe01cba177718 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 21 Sep 2016 16:29:00 -0400 Subject: [PATCH 1/3] dockcross: Add warning regarding location of DEFAULT_DOCKCROSS_IMAGE --- imagefiles/dockcross | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imagefiles/dockcross b/imagefiles/dockcross index 7a1f1ee..a6d80fe 100755 --- a/imagefiles/dockcross +++ b/imagefiles/dockcross @@ -1,6 +1,6 @@ #!/bin/bash -DEFAULT_DOCKCROSS_IMAGE=dockcross/base +DEFAULT_DOCKCROSS_IMAGE=dockcross/base # DO NOT MOVE THIS LINE (see entrypoint.sh) #------------------------------------------------------------------------------ # Helpers From 43e46710e6502b99812cdcd2b2c012df7b5e05f0 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 21 Sep 2016 16:31:09 -0400 Subject: [PATCH 2/3] dockcross: Add support for special update commands. Fixes #34 --- imagefiles/dockcross | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/imagefiles/dockcross b/imagefiles/dockcross index a6d80fe..3156293 100755 --- a/imagefiles/dockcross +++ b/imagefiles/dockcross @@ -93,6 +93,7 @@ ENDHELP #------------------------------------------------------------------------------ # Option processing # +special_update_command='' while [[ $# != 0 ]]; do case $1 in @@ -114,7 +115,10 @@ while [[ $# != 0 ]]; do ARG_IMAGE="$2" shift 2 ;; - + update|update-image|update-script) + special_update_command=$1 + break + ;; -*) err Unknown option \"$1\" command:help @@ -142,6 +146,11 @@ FINAL_CONFIG=${ARG_CONFIG-${DOCKCROSS_CONFIG-$DEFAULT_DOCKCROSS_CONFIG}} # Set the docker image FINAL_IMAGE=${ARG_IMAGE-${DOCKCROSS_IMAGE-$DEFAULT_DOCKCROSS_IMAGE}} +# Handle specicial update command +[[ "$special_update_command" == "update" ]] && command:update && exit +[[ "$special_update_command" == "update-script" ]] && command:update-script && exit +[[ "$special_update_command" == "update-image" ]] && command:update-image && exit + # Set the docker run extra args (if any) FINAL_ARGS=${ARG_ARGS-${DOCKCROSS_ARGS}} From c05d52310a8263bd813170147efba6f9807f58cb Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 21 Sep 2016 20:25:11 -0400 Subject: [PATCH 3/3] dockcross: Ensure running "update commands" exits script with correct status --- imagefiles/dockcross | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/imagefiles/dockcross b/imagefiles/dockcross index 3156293..7299c17 100755 --- a/imagefiles/dockcross +++ b/imagefiles/dockcross @@ -146,10 +146,27 @@ FINAL_CONFIG=${ARG_CONFIG-${DOCKCROSS_CONFIG-$DEFAULT_DOCKCROSS_CONFIG}} # Set the docker image FINAL_IMAGE=${ARG_IMAGE-${DOCKCROSS_IMAGE-$DEFAULT_DOCKCROSS_IMAGE}} -# Handle specicial update command -[[ "$special_update_command" == "update" ]] && command:update && exit -[[ "$special_update_command" == "update-script" ]] && command:update-script && exit -[[ "$special_update_command" == "update-image" ]] && command:update-image && exit +# Handle special update command +if [ "$special_update_command" != "" ]; then + case $special_update_command in + + update) + command:update + exit $? + ;; + + update-image) + command:update-image + exit $? + ;; + + update-script) + command:update-script + exit $? + ;; + + esac +fi # Set the docker run extra args (if any) FINAL_ARGS=${ARG_ARGS-${DOCKCROSS_ARGS}}