From c83baeb8e586783a03b0121b290de605a94c5592 Mon Sep 17 00:00:00 2001 From: Christoph Schranz Date: Tue, 10 Mar 2020 16:35:10 +0100 Subject: [PATCH] set head-commit for submodule --- generate_Dockerfile.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/generate_Dockerfile.sh b/generate_Dockerfile.sh index 8b84a31..d9ff098 100755 --- a/generate_Dockerfile.sh +++ b/generate_Dockerfile.sh @@ -4,12 +4,22 @@ cd $(cd -P -- "$(dirname -- "$0")" && pwd -P) # Set the path of the generated Dockerfile export DOCKERFILE=".build/Dockerfile" export STACKS_DIR=".build/docker-stacks" +export HEAD_COMMIT="c1c32938438151c7e2a22b5aa338caba2ec01da2" + +while [[ "$#" -gt 0 ]]; do case $1 in + -c|--commit) HEAD_COMMIT="$2"; shift;; + *) echo "Unknown parameter passed: $1" && + echo "Usage: $0 -c [sha-commit] # set the head commit of the docker-stacks submodule + (https://github.com/jupyter/docker-stacks/commits/master). default: $HEAD_COMMIT."; exit 1;; +esac; shift; done # Clone if docker-stacks doesn't exist, and pull. ls $STACKS_DIR/README.md > /dev/null 2>&1 || (echo "Docker-stacks was not found, cloning repository" \ && git clone https://github.com/jupyter/docker-stacks.git $STACKS_DIR) -cd $STACKS_DIR && git pull && cd - +#cd $STACKS_DIR && git pull && cd - +echo "Set docker-stacks to commit $HEAD_COMMIT." +cd $STACKS_DIR && git reset --hard $HEAD_COMMIT && cd - # Write the contents into the DOCKERFILE and start with the header