changeset 74:541766977a11

add script to connect to telnet console of usxsapp
author smith@nwoca.org
date Wed, 23 Mar 2016 16:37:35 +0100
parents d2c44193fbaa
children aa2fd199ba56
files scripts/console.sh utils/Dockerfile utils/docker-entrypoint.sh
diffstat 3 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/scripts/console.sh	Wed Mar 23 16:37:35 2016 +0100
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# connects to the telnet console of the application for the specified service of the current project
+source "$( dirname "${BASH_SOURCE[0]}")/.functions.sh"
+
+container=$(composeGetContainer ${1?"Must specify the app service of the console to connect to"} )
+
+ip=$(docker inspect -f '{{.NetworkSettings.IPAddress}}' $container)
+
+docker run -it -v ${PWD}:/tmp -v /ssdt:/ssdt --rm docker.ssdt.io/ssdt-utils telnet $ip 2000 | tee console.log
+
--- a/utils/Dockerfile	Mon Mar 21 22:17:55 2016 +0100
+++ b/utils/Dockerfile	Wed Mar 23 16:37:35 2016 +0100
@@ -10,7 +10,8 @@
 RUN apt-get install -y mercurial \
     && apt-get install -y curl \
     && apt-get install -y vim \
-    && apt-get install -y nano
+    && apt-get install -y nano \
+    && apt-get install -y telnet
 
 VOLUME /ssdt
 
--- a/utils/docker-entrypoint.sh	Mon Mar 21 22:17:55 2016 +0100
+++ b/utils/docker-entrypoint.sh	Wed Mar 23 16:37:35 2016 +0100
@@ -4,8 +4,8 @@
 if [ "$1" = 'update' ]; then
   cd $SSDT_HOME
   if [ ! -d ".hg" ]; then
-	  echo "cloning repository $SSDT_DOCKER  to $SSDT_HOME"
-	  mkdir -p $SSDT_HOME
+      echo "cloning repository $SSDT_DOCKER  to $SSDT_HOME"
+      mkdir -p $SSDT_HOME
       hg init
   fi
   echo "pulling updates"
@@ -17,4 +17,4 @@
 
   exec "$@"
 
-fi
\ No newline at end of file
+fi