From 669e6b0acf254e36ed5b8ad0726ea9f015923be7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Staff=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Thu, 5 Jul 2018 15:03:36 +0900 Subject: [PATCH] Add 'docker-shell' (#468) This commit extracts interactive shell creation routine from 'docker-build' and introduces it as 'docker-shell' command. Signed-off-by: Jonghyun Park --- scripts/command/docker-build | 7 ------- scripts/command/docker-shell | 11 +++++++++++ 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 scripts/command/docker-shell diff --git a/scripts/command/docker-build b/scripts/command/docker-build index 6aa1f4e..2da6db1 100644 --- a/scripts/command/docker-build +++ b/scripts/command/docker-build @@ -4,18 +4,11 @@ source "${NNCC_SCRIPT_PATH}/docker.configuration" BUILD_RESULT=0 -if [ "$DOCKER_INTERACTIVE" ]; then - DOCKER_RUN_OPTS+=" -it" - CMD="/bin/bash" - docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME $CMD - BUILD_RESULT=$? -else if [[ ${BUILD_RESULT} -eq 0 ]]; then CMD="./nncc build -j$(nproc)" docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME $CMD BUILD_RESULT=$? fi -fi docker_cleanup diff --git a/scripts/command/docker-shell b/scripts/command/docker-shell new file mode 100644 index 0000000..1c3918e --- /dev/null +++ b/scripts/command/docker-shell @@ -0,0 +1,11 @@ +#!/bin/bash + +source "${NNCC_SCRIPT_PATH}/docker.configuration" + +DOCKER_RUN_OPTS+=" -it" +docker run $DOCKER_RUN_OPTS $DOCKER_ENV_VARS $DOCKER_VOLUMES $DOCKER_IMAGE_NAME /bin/bash +EXITCODE=$? + +docker_cleanup + +exit $EXITCODE -- 2.7.4