Return-Path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profusion-mobi.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=g9TNaCgvp2deSf3dopRSwzLBOzxeGqjHOlzrcgekf98=; b=DmarvVxMQAWAOwnZTPvERvBxVmWCEJES4liEYamjCC4oo8+sEYihDaf3eUZj7KKbS3 3A+Rv+EQQIkP3MURMtpo3p1RFs6yiHzUCs9EM1ous75mqmoneY25GgE0bo99YVRR/zrI 9c/BR8OwbuiRVF7eLb/mbLpRUn/iM1HzT0e6DoQcCd/1mkj7lU9Yh+YZUNkOvoN86xEj 9LWFmtczYKSQy7bVsyFIXv1bpoCsJ32OzO1izgxDH7MHcOwxj4EzAjZ23Sfh/R529yrK Sc8BfhEwnYnxXxiMOt1UrL7E9DdLJuCrP3hNgnGKEql54HkcEFCOQFOlNvV21j4SSt8Z nQcQ== From: Guilherme Campos Camargo Date: Fri, 26 Jan 2018 15:35:37 -0200 Message-Id: <20180126173545.16424-2-guicc@profusion.mobi> In-Reply-To: <20180126173545.16424-1-guicc@profusion.mobi> References: <20180126173545.16424-1-guicc@profusion.mobi> Subject: [Fuego] [PATCH 1/9] Remove unused variables from docker build/create/run scripts List-Id: Mailing list for the Fuego test framework List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: fuego@lists.linuxfoundation.org The DIR variable is only being used by the CREATE scripts. There's no reason to keep it in the BUILD/REMOVE/START scripts as well. Signed-off-by: Guilherme Campos Camargo --- fuego-host-scripts/docker-build-image.sh | 9 +-------- fuego-host-scripts/docker-remove-container.sh | 8 -------- fuego-host-scripts/docker-remove-image.sh | 9 +-------- fuego-host-scripts/docker-start-container.sh | 8 -------- 4 files changed, 2 insertions(+), 32 deletions(-) diff --git a/fuego-host-scripts/docker-build-image.sh b/fuego-host-scripts/docker-build-image.sh index a197dc5..7c11b11 100755 --- a/fuego-host-scripts/docker-build-image.sh +++ b/fuego-host-scripts/docker-build-image.sh @@ -1,12 +1,5 @@ +#!/bin/bash # $1 - name for the docker image (default: fuego) -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - DOCKERIMAGE=${1:-fuego} if [ "$(id -u)" == "0" ]; then diff --git a/fuego-host-scripts/docker-remove-container.sh b/fuego-host-scripts/docker-remove-container.sh index 2aae6a9..00c7ac9 100755 --- a/fuego-host-scripts/docker-remove-container.sh +++ b/fuego-host-scripts/docker-remove-container.sh @@ -1,13 +1,5 @@ #!/bin/bash # $1 - name for the docker container (default: fuego-container) -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - DOCKERCONTAINER=${1:-fuego-container} sudo docker rm ${DOCKERCONTAINER} diff --git a/fuego-host-scripts/docker-remove-image.sh b/fuego-host-scripts/docker-remove-image.sh index 91dbda7..4c24684 100755 --- a/fuego-host-scripts/docker-remove-image.sh +++ b/fuego-host-scripts/docker-remove-image.sh @@ -1,12 +1,5 @@ +#!/bin/bash # $1 - name for the docker image (default: fuego) -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - DOCKERIMAGE=${1:-fuego} sudo docker rmi ${DOCKERIMAGE} diff --git a/fuego-host-scripts/docker-start-container.sh b/fuego-host-scripts/docker-start-container.sh index d9de85a..d0cee1a 100755 --- a/fuego-host-scripts/docker-start-container.sh +++ b/fuego-host-scripts/docker-start-container.sh @@ -1,13 +1,5 @@ #!/bin/bash # $1 - name for the docker container (default: fuego-container) -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - DOCKERCONTAINER=${1:-fuego-container} echo "Starting Fuego container (${DOCKERCONTAINER})" -- 2.15.1