changeset 86:b997ad087ac1

DEP-12: modify utils image to pull production branch from ssdt-docker by default
author smith@nwoca.org
date Thu, 22 Sep 2016 01:48:13 +0100
parents 5fae3adac2af
children 831afa93cbb1 da49fcb26e2d
files update.sh utils/Dockerfile utils/docker-entrypoint.sh
diffstat 3 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/update.sh	Tue Aug 30 16:37:52 2016 +0100
+++ b/update.sh	Thu Sep 22 01:48:13 2016 +0100
@@ -1,3 +1,4 @@
 #!/bin/bash
+SSDT_HOME="$( dirname "${BASH_SOURCE[0]}")"
 docker pull docker.ssdt.io/ssdt-utils
-docker run -it -v /ssdt:/ssdt --rm docker.ssdt.io/ssdt-utils update
+docker run -it -v $SSDT_HOME:/ssdt --rm docker.ssdt.io/ssdt-utils update
--- a/utils/Dockerfile	Tue Aug 30 16:37:52 2016 +0100
+++ b/utils/Dockerfile	Thu Sep 22 01:48:13 2016 +0100
@@ -13,8 +13,6 @@
     && apt-get install -y nano \
     && apt-get install -y telnet
 
-VOLUME /ssdt
-
 COPY ./docker-entrypoint.sh /
 
 RUN chmod a+x ./docker-entrypoint.sh
--- a/utils/docker-entrypoint.sh	Tue Aug 30 16:37:52 2016 +0100
+++ b/utils/docker-entrypoint.sh	Thu Sep 22 01:48:13 2016 +0100
@@ -2,16 +2,17 @@
 set -e
 
 if [ "$1" = 'update' ]; then
+  mkdir -p $SSDT_HOME
   cd $SSDT_HOME
   if [ ! -d ".hg" ]; then
       echo "cloning repository $SSDT_DOCKER  to $SSDT_HOME"
-      mkdir -p $SSDT_HOME
       hg init
   fi
-  echo "pulling updates"
+  branch=${2:-production}
+  echo "pulling updates from $SSDT_DOCKER ($branch)"
   hg pull -y $SSDT_DOCKER
   hg revert -a
-  hg update default
+  hg update $branch
 
 else