Mercurial > public > ssdt-docker
comparison scripts/console.sh @ 163:daf91a3bbee5 production v1.2.0
flow: Merged <release> 'v1.2.0' to <master> ('production').
author | smith@nwoca.org |
---|---|
date | Tue, 15 Aug 2017 21:59:23 +0100 |
parents | 8f45c43ea7a4 |
children | ae2b4a5294ff |
comparison
equal
deleted
inserted
replaced
141:06611703da29 | 163:daf91a3bbee5 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # connects to the telnet console of the application for the specified service of the current project | |
3 # For docker 1.12 and compose 1.9 (and higher) assume project is assigned to a network | |
4 # named "${project}_default" per SSDT templates. | |
2 | 5 |
3 # connects to the telnet console of the application for the specified service of the current project | |
4 source "$( dirname "${BASH_SOURCE[0]}")/.functions.sh" | 6 source "$( dirname "${BASH_SOURCE[0]}")/.functions.sh" |
5 | 7 |
6 container=$(composeGetContainer ${1?"Must specify the app service of the console to connect to"} ) | 8 container=$(composeGetContainer ${1?"Must specify the app service of the console to connect to"} ) |
7 | 9 |
8 ip=$(docker inspect -f '{{.NetworkSettings.IPAddress}}' $container) | 10 ip=$(docker inspect -f '{{.NetworkSettings.IPAddress}}' $container) |
9 | 11 |
10 docker run -it -v ${PWD}:/tmp -v /ssdt:/ssdt --rm docker.ssdt.io/ssdt-utils telnet $ip 2000 | tee console.log | 12 if [ "$ip" == "" ] |
13 then | |
14 ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $container) | |
15 project=$(composeGetProject ${1} ) | |
16 fi | |
11 | 17 |
18 if [ "$project" == "" ] | |
19 then | |
20 docker run -it -v ${PWD}:/tmp -v ${SSDT_HOME}:/ssdt --rm docker.ssdt.io/ssdt-utils telnet $ip 2000 | tee console.log | |
21 else | |
22 docker run -it --network ${project}_default --rm docker.ssdt.io/ssdt-utils telnet $ip 2000 | tee console.log | |
23 fi |