commit ad5ed75b3b5faa1dcf87f576955c52b3f8c444bd
Author: Elan Ruusamäe <[email protected]>
Date:   Wed Jan 23 16:43:04 2019 +0200

    add --keep-container option

 cleanbuild-docker.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/cleanbuild-docker.sh b/cleanbuild-docker.sh
index ffec62e..82f9021 100755
--- a/cleanbuild-docker.sh
+++ b/cleanbuild-docker.sh
@@ -7,6 +7,7 @@ PROGRAM=${0##*/}
 : ${PACKAGE_NAME=''}
 : ${NETWORKING=false}
 : ${TRACING=false}
+: ${KEEP_CONTAINER=false}
 : ${TMPFS="4G"}
 
 dir=$(pwd)
@@ -121,7 +122,7 @@ package_build() {
 
                docker exec --user=root -w / $name 
$home/cleanbuild/findunusedbr -c / 
$home/rpm/packages/$PACKAGE_NAME/$PACKAGE_NAME.spec
 
-               if [ $rc -eq 0 ]; then
+               if [ $rc -eq 0 ] && ! $KEEP_CONTAINER; then
                        # finished ok, cleanup
                        docker kill $name >/dev/null && docker rm $name 
>/dev/null || :
                fi
@@ -133,7 +134,7 @@ package_build() {
 
 parse_options() {
        local t
-       t=$(getopt -o 'x' --long 'network,no-tmpfs,notmpfs,tmpfs:' -n 
"$PROGRAM" -- "$@")
+       t=$(getopt -o 'x' --long 
'network,no-tmpfs,notmpfs,tmpfs:,keep-container' -n "$PROGRAM" -- "$@")
        [ $? != 0 ] && exit $?
        eval set -- "$t"
 
@@ -152,6 +153,9 @@ parse_options() {
                        shift
                        TMPFS="$1"
                        ;;
+               --keep-container)
+                       KEEP_CONTAINER=true
+                       ;;
                --)
                        shift
                        break
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/cleanbuild.git/commitdiff/ad5ed75b3b5faa1dcf87f576955c52b3f8c444bd

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to