annotate scripts/console.sh @ 165:37d03f440b4b hotfix/v1.2.1

flow: Created branch 'hotfix/v1.2.1'.
author smith@nwoca.org
date Wed, 16 Aug 2017 16:11:17 +0100
parents 8f45c43ea7a4
children ae2b4a5294ff
rev   line source
44
e5ba33051de7 add scripts and compose file for importing from server
Dave smith <smith@nwoca.org>
parents:
diff changeset
1 #!/bin/bash
85
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
2 # connects to the telnet console of the application for the specified service of the current project
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
3 # For docker 1.12 and compose 1.9 (and higher) assume project is assigned to a network
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
4 # named "${project}_default" per SSDT templates.
44
e5ba33051de7 add scripts and compose file for importing from server
Dave smith <smith@nwoca.org>
parents:
diff changeset
5
73
d2c44193fbaa explictly remove db's before import
smith@nwoca.org
parents: 65
diff changeset
6 source "$( dirname "${BASH_SOURCE[0]}")/.functions.sh"
d2c44193fbaa explictly remove db's before import
smith@nwoca.org
parents: 65
diff changeset
7
74
541766977a11 add script to connect to telnet console of usxsapp
smith@nwoca.org
parents: 73
diff changeset
8 container=$(composeGetContainer ${1?"Must specify the app service of the console to connect to"} )
44
e5ba33051de7 add scripts and compose file for importing from server
Dave smith <smith@nwoca.org>
parents:
diff changeset
9
74
541766977a11 add script to connect to telnet console of usxsapp
smith@nwoca.org
parents: 73
diff changeset
10 ip=$(docker inspect -f '{{.NetworkSettings.IPAddress}}' $container)
44
e5ba33051de7 add scripts and compose file for importing from server
Dave smith <smith@nwoca.org>
parents:
diff changeset
11
85
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
12 if [ "$ip" == "" ]
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
13 then
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
14 ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $container)
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
15 project=$(composeGetProject ${1} )
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
16 fi
74
541766977a11 add script to connect to telnet console of usxsapp
smith@nwoca.org
parents: 73
diff changeset
17
85
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
18 if [ "$project" == "" ]
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
19 then
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
20 docker run -it -v ${PWD}:/tmp -v ${SSDT_HOME}:/ssdt --rm docker.ssdt.io/ssdt-utils telnet $ip 2000 | tee console.log
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
21 else
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
22 docker run -it --network ${project}_default --rm docker.ssdt.io/ssdt-utils telnet $ip 2000 | tee console.log
8f45c43ea7a4 DEP-12: start upgrading scripts and compose files for RC and docker 1.12
Dave Smith <smith@nwoca.org>
parents: 74
diff changeset
23 fi