# HG changeset patch # User smith@nwoca.org # Date 1492791444 -3600 # Node ID dc3696525de42aea54b4592bb140497d67e99e14 # Parent bd1f900972edd9e5f520bfe427cd3129c9e7eff5# Parent 5e3cf6b7e3311638d34db1db53074b29914ecbb7 merge from default diff -r 5e3cf6b7e331 -r dc3696525de4 .hgignore --- a/.hgignore Tue Apr 11 02:18:48 2017 +0100 +++ b/.hgignore Fri Apr 21 17:17:24 2017 +0100 @@ -1,5 +1,5 @@ syntax: regexp -^\.DS_Store +\.DS_Store .*~$ \.orig$ \.orig\..*$ diff -r 5e3cf6b7e331 -r dc3696525de4 compose2/preview/training.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compose2/preview/training.yml Fri Apr 21 17:17:24 2017 +0100 @@ -0,0 +1,41 @@ +usasdb: + restart: unless-stopped + image: docker.ssdt.io/trainingdb-usas + environment: + - DB_NAME=usasdb + - DB_USER=usas + - DB_PASS=usasdefault +usasapp: + restart: unless-stopped + image: docker.ssdt.io/usas-app:preview + volumes: + - ${PWD}/config:/config + environment: + - DB_HOST=usas-database + - DB_NAME=usasdb + - DB_USER=usas + - DB_PASS=usasdefault + - JAVA_OPTS=-Xmx640m + links: + - usasdb:usas-database +uspsdb: + restart: unless-stopped + image: docker.ssdt.io/trainingdb-usps + environment: + - DB_NAME=uspsdb + - DB_USER=usps + - DB_PASS=uspsdefault +uspsapp: + restart: unless-stopped + image: docker.ssdt.io/usps-app:preview + volumes: + - ${PWD}/config:/config + environment: + - DB_HOST=usps-database + - DB_NAME=uspsdb + - DB_USER=usps + - DB_PASS=uspsdefault + - JAVA_OPTS=-Xmx640m + links: + - uspsdb:usps-database + diff -r 5e3cf6b7e331 -r dc3696525de4 compose2/preview/usas-template.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compose2/preview/usas-template.yml Fri Apr 21 17:17:24 2017 +0100 @@ -0,0 +1,12 @@ +version: "2" +services: + usasdb: + extends: + file: /ssdt/compose/preview/usas.yml + service: usasdb + volumes: + - |volumeName|:/var/lib/postgresql/data + usasapp: + extends: + file: /ssdt/compose/preview/usas.yml + service: usasapp \ No newline at end of file diff -r 5e3cf6b7e331 -r dc3696525de4 compose2/preview/usas.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compose2/preview/usas.yml Fri Apr 21 17:17:24 2017 +0100 @@ -0,0 +1,20 @@ +version: "2" +services: + usasdb: + restart: unless-stopped + image: docker.ssdt.io/ssdt-postgres:3 + environment: + - DB_NAME=usasdb + - DB_USER=usas + - DB_PASS=usasdefault + usasapp: + restart: unless-stopped + image: docker.ssdt.io/usas-app:preview + environment: + - DB_HOST=usasdb + - DB_NAME=usasdb + - DB_USER=usas + - DB_PASS=usasdefault + - ORG_SSDT_OHIO_USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_SERVERHOST=uspsapp + - ORG_SSDT_OHIO_USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_SERVERDNSLOOKUP=true + diff -r 5e3cf6b7e331 -r dc3696525de4 compose2/preview/usps.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compose2/preview/usps.yml Fri Apr 21 17:17:24 2017 +0100 @@ -0,0 +1,20 @@ +# base compose file for usps Release Candidate release +version: "2" +services: + uspsdb: + restart: unless-stopped + image: docker.ssdt.io/ssdt-postgres:3 + environment: + - DB_NAME=uspsdb + - DB_USER=usps + - DB_PASS=uspsdefault + uspsapp: + restart: unless-stopped + image: docker.ssdt.io/usps-app:preview + environment: + - DB_HOST=uspsdb + - DB_NAME=uspsdb + - DB_USER=usps + - DB_PASS=uspsdefault + - ORG_SSDT_OHIO_USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_SERVERHOST=usasapp + - ORG_SSDT_OHIO_USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_SERVERDNSLOOKUP=true diff -r 5e3cf6b7e331 -r dc3696525de4 init.sh --- a/init.sh Tue Apr 11 02:18:48 2017 +0100 +++ b/init.sh Fri Apr 21 17:17:24 2017 +0100 @@ -1,3 +1,6 @@ #!/bin/bash -alias utils='docker run -it -v ${PWD}:/tmp -v /ssdt:/ssdt --rm docker.ssdt.io/ssdt-utils' -alias send2ssdt='/ssdt/scripts/send.sh' \ No newline at end of file +source "$( dirname "${BASH_SOURCE[0]}")/scripts/.functions.sh" +alias utils='docker run -it -v ${PWD}:/tmp -v $SSDT_HOME:/ssdt --rm docker.ssdt.io/ssdt-utils' +alias send2ssdt='/ssdt/scripts/send.sh' + +export PATH=$PATH:$SSDT_HOME/scripts diff -r 5e3cf6b7e331 -r dc3696525de4 scripts/.functions.sh --- a/scripts/.functions.sh Tue Apr 11 02:18:48 2017 +0100 +++ b/scripts/.functions.sh Fri Apr 21 17:17:24 2017 +0100 @@ -1,4 +1,6 @@ #!/bin/bash +export SSDT_SCRIPTS=$(dirname "${BASH_SOURCE[0]}") +export SSDT_HOME=$(dirname $SSDT_SCRIPTS) # deletes psql data from specified service resetDbVolume() { @@ -26,4 +28,10 @@ container=$(composeGetContainer $service) echo "$2" | docker exec -i $container sh -c "gosu postgres psql \$DB_NAME" -} \ No newline at end of file +} + +composeGetProject() { + service=${1?"Must supply service from current project"} + container=$(composeGetContainer $service) + echo $(docker inspect -f '{{index .Config.Labels "com.docker.compose.project" }}' $container) +} diff -r 5e3cf6b7e331 -r dc3696525de4 scripts/capture.sh --- a/scripts/capture.sh Tue Apr 11 02:18:48 2017 +0100 +++ b/scripts/capture.sh Fri Apr 21 17:17:24 2017 +0100 @@ -1,3 +1,3 @@ #!/bin/bash -# writes tail of current logs to standard out from running containers in compose project. -docker-compose ps -q | xargs -I ID docker inspect --format='{{.LogPath}}' ID | xargs tail -n${1-8000} +# writes tail of current logs to standard out from containers in compose project. +docker-compose logs --no-color $1 \ No newline at end of file diff -r 5e3cf6b7e331 -r dc3696525de4 scripts/console.sh --- a/scripts/console.sh Tue Apr 11 02:18:48 2017 +0100 +++ b/scripts/console.sh Fri Apr 21 17:17:24 2017 +0100 @@ -1,11 +1,23 @@ #!/bin/bash +# connects to the telnet console of the application for the specified service of the current project +# For docker 1.12 and compose 1.9 (and higher) assume project is assigned to a network +# named "${project}_default" per SSDT templates. -# 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 +if [ "$ip" == "" ] +then + ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $container) + project=$(composeGetProject ${1} ) +fi +if [ "$project" == "" ] +then + docker run -it -v ${PWD}:/tmp -v ${SSDT_HOME}:/ssdt --rm docker.ssdt.io/ssdt-utils telnet $ip 2000 | tee console.log +else + docker run -it --network ${project}_default --rm docker.ssdt.io/ssdt-utils telnet $ip 2000 | tee console.log +fi diff -r 5e3cf6b7e331 -r dc3696525de4 scripts/info.sh --- a/scripts/info.sh Tue Apr 11 02:18:48 2017 +0100 +++ b/scripts/info.sh Fri Apr 21 17:17:24 2017 +0100 @@ -1,13 +1,13 @@ #!/bin/bash + source "$( dirname "${BASH_SOURCE[0]}")/.functions.sh" echo $BASH_VERSION docker version docker-compose version echo "------- Docker info-------------" docker info echo "------- Images -----------------" -/ssdt/scripts/d-images.sh + $SSDT_HOME/scripts/d-images.sh echo "------- Containers------" -/ssdt/scripts/d-ps.sh + $SSDT_HOME/scripts/d-ps.sh echo "------- OS Processes------------" top -b -n 1 - diff -r 5e3cf6b7e331 -r dc3696525de4 scripts/send.sh --- a/scripts/send.sh Tue Apr 11 02:18:48 2017 +0100 +++ b/scripts/send.sh Fri Apr 21 17:17:24 2017 +0100 @@ -1,4 +1,12 @@ #!/bin/bash +# +# Securely sends a file or standard input to a SSDT web server. +# e.g: +# capture.sh | send.sh - # sends log files to ssdt server for the current project +# send.sh docker-compose.yml # sends the compose file +# +source "$( dirname "${BASH_SOURCE[0]}")/.functions.sh" + file=${1?"Usage: $0 filename [name]\n specify the filename relative to the current directory or - for stdin.\noptionally specify a short name (default to base directory)"} if [ "$file" != "-" ] then @@ -6,5 +14,6 @@ fi name=${2:-$(basename $PWD)} source=$(hostname) -docker run -i -v /ssdt:/ssdt -v ${PWD}:/tmp --rm docker.ssdt.io/ssdt-utils \ + +docker run -i -v $SSDT_HOME:/ssdt -v ${PWD}:/tmp --rm docker.ssdt.io/ssdt-utils \ curl -F source=$source -F name=$name -F file=@$file https://upload.ssdt.io/upload \ No newline at end of file