annotate scripts/console.sh @ 406:3508fd2d323a production 2.14.0

flow: Merged <release> '2.14.0' to <master> ('production').
author Jason Klinger <klinger@nwoca.org>
date Fri, 20 May 2022 20:14:22 +0100
parents ae2b4a5294ff
children 9afc8cb478f6
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
179
ae2b4a5294ff DEP-12: fix console script for containers in multiple networks
smith@nwoca.org
parents: 85
diff changeset
6 source "${SSDT_SCRIPTS:-$(dirname "${BASH_SOURCE[0]}")}/.functions.sh"
73
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 project=$(composeGetProject ${1} )
179
ae2b4a5294ff DEP-12: fix console script for containers in multiple networks
smith@nwoca.org
parents: 85
diff changeset
15 ip=$(docker inspect -f "{{with .NetworkSettings.Networks}}{{.${project}_default.IPAddress}}{{end}}" $container)
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
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
179
ae2b4a5294ff DEP-12: fix console script for containers in multiple networks
smith@nwoca.org
parents: 85
diff changeset
22 echo "connecting to telnet console on ${container} in ${project}"
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
23 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
24 fi
179
ae2b4a5294ff DEP-12: fix console script for containers in multiple networks
smith@nwoca.org
parents: 85
diff changeset
25