Mercurial > public > ssdt-docker
changeset 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 | 06611703da29 (current diff) baf48e092553 (diff) |
children | 29bdfe86d9a9 |
files | |
diffstat | 24 files changed, 453 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Fri Jun 16 17:14:15 2017 +0100 +++ b/.hgignore Tue Aug 15 21:59:23 2017 +0100 @@ -1,5 +1,5 @@ syntax: regexp -^\.DS_Store +\.DS_Store .*~$ \.orig$ \.orig\..*$
--- a/init.sh Fri Jun 16 17:14:15 2017 +0100 +++ b/init.sh Tue Aug 15 21:59:23 2017 +0100 @@ -1,3 +1,12 @@ #!/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 +getSsdtHomeDir() { + SOURCE="${BASH_SOURCE[0]}" + while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done + echo $( cd $( dirname $SOURCE) && pwd ) +} + +export SSDT_HOME=$(getSsdtHomeDir) +export SSDT_SCRIPTS=${SSDT_HOME}/scripts +source "${SSDT_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'
--- a/java/Dockerfile Fri Jun 16 17:14:15 2017 +0100 +++ b/java/Dockerfile Tue Aug 15 21:59:23 2017 +0100 @@ -1,11 +1,15 @@ -FROM docker.ssdt.io/java:8-jre +FROM openjdk:8u121-jdk MAINTAINER Dave Smith <smith@nwoca.org> -RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections \ - && echo 'deb http://httpredir.debian.org/debian jessie contrib' > /etc/apt/sources.list.d/jessie-contrib.list \ - && apt-get update \ - && apt-get install -y ttf-mscorefonts-installer +RUN echo "deb http://httpredir.debian.org/debian jessie main contrib" > /etc/apt/sources.list \ + && echo "deb http://security.debian.org/ jessie/updates main contrib" >> /etc/apt/sources.list \ + && echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections \ + && apt-get update \ + && apt-get install -y ttf-mscorefonts-installer \ + && apt-get clean \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* ENV TZ=America/New_York
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pilot/import-usas.sh Tue Aug 15 21:59:23 2017 +0100 @@ -0,0 +1,22 @@ +#!/bin/bash + +source "$( dirname "${BASH_SOURCE[0]}")/../scripts/.functions.sh" + +docker-compose stop usasapp usasdb +resetDbVolume usasdb +docker-compose rm -vf usasapp usasdb + +export IMP_IRN=${IMP_IRN} +export IMP_URL=${IMP_URL-ftp://username:password@nwoca.org} +export IMP_PATH=${IMP_PATH} + +[ -f "docker-compose.override.yml" ] && export OVERRIDE=" -f docker-compose.override.yml" +# +docker-compose -f docker-compose.yml -f ${SSDT_HOME}/pilot/import-usas.yml $OVERRIDE rm -f usasimport +# start import and wait for completion +docker-compose -f docker-compose.yml -f ${SSDT_HOME}/pilot/import-usas.yml $OVERRIDE up usasimport | tee usasimport.log +# remove temporary container +docker-compose -f docker-compose.yml -f ${SSDT_HOME}/pilot/import-usas.yml $OVERRIDE rm -f usasimport +# start application +docker-compose up -d usasapp +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pilot/import-usas.yml Tue Aug 15 21:59:23 2017 +0100 @@ -0,0 +1,12 @@ +version: "3.3" +services: + usasimport: + image: docker.ssdt.io/usas-import:${USAS_TAG:-pilot} + command: -i ${IMP_IRN- } -u ${IMP_URL- } -r ${IMP_PATH- } + depends_on: + - usasdb + environment: + - DB_HOST=usasdb + - DB_NAME=usasdb + - DB_USER=usas + - DB_PASS=${USAS_DB_PASSWORD:-usasdefault} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pilot/import-usps.sh Tue Aug 15 21:59:23 2017 +0100 @@ -0,0 +1,23 @@ +#!/bin/bash + +source "$( dirname "${BASH_SOURCE[0]}")/../scripts/.functions.sh" + +docker-compose stop uspsapp uspsdb +resetDbVolume uspsdb +docker-compose rm -vf uspsapp uspsdb + +export IMP_IRN=${IMP_IRN} +export IMP_URL=${IMP_URL-ftp://username:password@nwoca.org} +export IMP_PATH=${IMP_PATH} +export IMP_ANON=${IMP_ANON:--a false} +export IMP_EM=${IMP_EM-} + +[ -f "docker-compose.override.yml" ] && export OVERRIDE=" -f docker-compose.override.yml" + +docker-compose -f docker-compose.yml -f ${SSDT_HOME}/pilot/import-usps.yml $OVERRIDE rm -f uspsimport +# start import and wait for completion +docker-compose -f docker-compose.yml -f ${SSDT_HOME}/pilot/import-usps.yml $OVERRIDE up uspsimport | tee uspsimport.log +# remove temporary container +docker-compose -f docker-compose.yml -f ${SSDT_HOME}/pilot/import-usps.yml $OVERRIDE rm -f uspsimport +# start application +docker-compose up -d uspsapp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pilot/import-usps.yml Tue Aug 15 21:59:23 2017 +0100 @@ -0,0 +1,13 @@ +version: "3.3" +services: + uspsimport: + image: docker.ssdt.io/usps-import:${USPS_TAG:-pilot} + command: -i ${IMP_IRN- } -u ${IMP_URL- } -r ${IMP_PATH- } ${IMP_ANON- } ${IMP_EM- } + depends_on: + - uspsdb + environment: + - DB_HOST=uspsdb + - DB_NAME=uspsdb + - DB_USER=usps + - DB_PASS=${USPS_DB_PASSWORD:-uspsdefault} + \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pilot/setup.sh Tue Aug 15 21:59:23 2017 +0100 @@ -0,0 +1,126 @@ +#!/bin/bash +# Sets up a new district project based on SSDT default configuration in the current working directory. +# +# Usage: +# +# /data/preview/sampletown $ /ssdt/compose2/preview/setup.sh [usas,usps...] +# +# Will create a docker-compose.yml and .env file with default settings. +# +# +source "$(dirname "${BASH_SOURCE[0]}")/../scripts/.functions.sh" + +md5calc() { + md5sum ${1} ; +} + +md5verify() { + md5sum -c --status ${1} ; +} + +genDBHash() { + echo $(date +%s%N | sha256sum | base64 | head -c 32 ; echo) +} + +base=$(dirname "${BASH_SOURCE[0]}") +default_name=$(basename $PWD) + +args="$1$2" + +usas="" +usps="" + +if [ "$args" == "" ] || [ -z "${args##*usas*}" ] +then + usas=1 +fi + +if [ "$args" == "" ] || [ -z "${args##*usps*}" ] +then + usps=1 +fi + +echo "Preparing '$(basename $PWD)' with default USxS configuration" + +touch .env +source .env + +if [ "$COMPOSE_PROJECT_NAME" == "" ] +then + read -e -p "Enter project name: <${default_name}> " answer + project_name=${answer:-$default_name} + echo "COMPOSE_PROJECT_NAME=${project_name}" >> .env + echo "set project name in .env file" + source .env +fi + +if [ ! -e "docker-compose.yml" ] +then + create="OK" +elif [ -e ".docker-compose.md5" ]; then + md5verify ./.docker-compose.md5 && create="OK" +fi + +if [ "$create" == "OK" ] +then + echo "# **** DO NOT MODIFY THIS FILE. ****" > ./docker-compose.yml + echo "# Place customizations in docker-compose.override.yml and .env" >> ./docker-compose.yml + echo "version: \"3.3\"" >> ./docker-compose.yml + echo "services:" >> ./docker-compose.yml + + [ ! "$usas" == "" ] && cat $base/usas-services.yml >> ./docker-compose.yml + + [ ! "$usps" == "" ] && cat $base/usps-services.yml >> ./docker-compose.yml + + echo "volumes:" >> ./docker-compose.yml + + if [ ! "$usas" == "" ] + then + echo " usasdata:" >> ./docker-compose.yml + [ "$USAS_DB_PASSWORD" == "" ] && echo "USAS_DB_PASSWORD=$(genDBHash)" >> ./.env + fi + + if [ ! "$usps" == "" ] + then + echo " uspsdata:" >> ./docker-compose.yml + [ "$USPS_DB_PASSWORD" == "" ] && echo "USPS_DB_PASSWORD=$(genDBHash)" >> ./.env + fi + + echo "" >> ./docker-compose.yml + + md5calc ./docker-compose.yml > .docker-compose.md5 + + echo "created docker-compose.yml" + +else + echo " + + Error! docker-compose.yml file has been modified or checksum missing. Can not auto-apply update(s). + Move customizations to docker-compose.override.yml then delete the docker-compose.yml +" +fi + +if [ "$USAS_APPLICATIONID" == "" ] +then + read -e -p "Generate USAS and USPS integration config? <Y/n> " answer + case $answer in + y | Y | yes | YES ) answer="y";; + n | N | no | NO ) answer="n";; + *) answer="y" + esac + if [ "$answer" == "y" ] + then + usas_id=${COMPOSE_PROJECT_NAME}-usas + usas_key=$(openssl rand -hex 32) + usps_id=${COMPOSE_PROJECT_NAME}-usps + usps_key=$(openssl rand -hex 32) + echo "USAS_APPLICATIONID=${usas_id}" >> .env + echo "USAS_APIKEY=$usas_key" >> .env + echo "USPS_APPLICATIONID=${usps_id}" >> .env + echo "USPS_APIKEY=$usps_key" >> .env + echo "Created integration API keys. Enable integration modules after applications start" + fi +fi + +echo "Review or create a docker-compose.override.yml for custom settings." +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pilot/training.yml Tue Aug 15 21:59:23 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:${USAS_TAG:-pilot} + 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:${USPS_TAG:-pilot} + 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 +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pilot/usas-services.yml Tue Aug 15 21:59:23 2017 +0100 @@ -0,0 +1,31 @@ + usasdb: + restart: unless-stopped + image: docker.ssdt.io/ssdt-postgres:5 + volumes: + - usasdata:/var/lib/postgresql/data + networks: + - default + environment: + - DB_NAME=usasdb + - DB_USER=usas + - DB_PASS=${USAS_DB_PASSWORD:-usasdefault} + usasapp: + restart: unless-stopped + image: docker.ssdt.io/usas-app:${USAS_TAG:-pilot} + depends_on: + - usasdb + networks: + - default + environment: + - DB_HOST=usasdb + - DB_NAME=usasdb + - DB_USER=usas + - DB_PASS=${USAS_DB_PASSWORD:-usasdefault} + - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_CLIENTHOST=uspsapp + - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_CLIENTDNSLOOKUP=true + - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_SERVERHOST=0.0.0.0 + - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_SERVERHOSTDNSLOOKUP=false + - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_APPLICATIONID=${USAS_APPLICATIONID:- } + - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_APIKEY=${USAS_APIKEY:- } + - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_REMOTEAPPLICATIONID=${USPS_APPLICATIONID:- } + - USAS_MODULE_USPSINTEGRATION_CONFIGURATION_USPSCONFIGURATION_REMOTEAPIKEY=${USPS_APIKEY:- }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pilot/usps-services.yml Tue Aug 15 21:59:23 2017 +0100 @@ -0,0 +1,31 @@ + uspsdb: + restart: unless-stopped + image: docker.ssdt.io/ssdt-postgres:5 + volumes: + - uspsdata:/var/lib/postgresql/data + networks: + - default + environment: + - DB_NAME=uspsdb + - DB_USER=usps + - DB_PASS=${USPS_DB_PASSWORD:-uspsdefault} + uspsapp: + restart: unless-stopped + image: docker.ssdt.io/usps-app:${USPS_TAG:-pilot} + depends_on: + - uspsdb + networks: + - default + environment: + - DB_HOST=uspsdb + - DB_NAME=uspsdb + - DB_USER=usps + - DB_PASS=${USPS_DB_PASSWORD:-uspsdefault} + - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_CLIENTHOST=usasapp + - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_CLIENTDNSLOOKUP=true + - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_SERVERHOST=0.0.0.0 + - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_SERVERHOSTDNSLOOKUP=false + - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_APPLICATIONID=${USPS_APPLICATIONID:- } + - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_APIKEY=${USPS_APIKEY:- } + - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_REMOTEAPPLICATIONID=${USAS_APPLICATIONID:- } + - USPS_MODULE_USASINTEGRATION_CONFIGURATION_USASCONFIGURATION_REMOTEAPIKEY=${USAS_APIKEY:- }
--- a/postgres/Dockerfile Fri Jun 16 17:14:15 2017 +0100 +++ b/postgres/Dockerfile Tue Aug 15 21:59:23 2017 +0100 @@ -1,7 +1,7 @@ # # Docker file to create postgres image for ssdt applications -FROM postgres:9.4.5 +FROM postgres:9.6.3 MAINTAINER Dave Smith smith@nwoca.org @@ -21,3 +21,14 @@ RUN echo $TZ > /etc/timezone \ && dpkg-reconfigure --frontend noninteractive tzdata + +COPY ssdt-entrypoint.sh /usr/local/bin/ + +RUN chmod 755 /usr/local/bin/ssdt-entrypoint.sh + +LABEL "io.ssdt.type"="db" + +ENTRYPOINT ["ssdt-entrypoint.sh"] + +CMD ["postgres"] + \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/postgres/ssdt-entrypoint.sh Tue Aug 15 21:59:23 2017 +0100 @@ -0,0 +1,6 @@ +#!/bin/bash +if [ ! "$POSTGRES_PASSWORD" ]; then + export POSTGRES_PASSWORD=$(date +%s | sha256sum | base64 | head -c 32 ; echo) +fi + +docker-entrypoint.sh "$@" \ No newline at end of file
--- a/scripts/.functions.sh Fri Jun 16 17:14:15 2017 +0100 +++ b/scripts/.functions.sh Tue Aug 15 21:59:23 2017 +0100 @@ -1,4 +1,17 @@ #!/bin/bash +getScriptDir() { + SOURCE="${BASH_SOURCE[0]}" + while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done + echo $( cd $( dirname $SOURCE) && pwd ) +} + +if [ "$SSDT_HOME" == "" ] +then + export SSDT_SCRIPTS=$(getScriptDir) + export SSDT_HOME=$(dirname $SSDT_SCRIPTS) +fi + +export SSDT_DOCKER_VERSION=$(docker version --format '{{.Server.Version}}') # deletes psql data from specified service resetDbVolume() { @@ -26,4 +39,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) +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/backup-container.sh Tue Aug 15 21:59:23 2017 +0100 @@ -0,0 +1,38 @@ +#!/bin/bash +# Executes a database backup for the specifed database container. +# The current directory is expected to contaion a project configured +# as with SSDT conventions for an application database. +# +# When successful, the output file will be in ./backup with the +# container name and timestamp in the file. The format of the output +# is a compressed pg_dump (sql) format. +# +container=${1?Must provide container name to backup} + +source "${SSDT_SCRIPTS:-$(dirname "${BASH_SOURCE[0]}")}/.functions.sh" + +set -o pipefail +mkdir -p ./backup +backupFile=./backup/${container}.$(date +%Y-%m-%d-%H-%M-%S).backup + +project=$(composeGetProject $container) + +if [ "$project" == "" ]; then + echo "no project available" + exit 1 +fi + +echo "starting backup of $container for $project" +docker-compose exec $container sh -c "gosu postgres pg_dump -Cc --if-exists --dbname=$container ; (exit $?) " > ${backupFile} + +if [[ $( grep --count "CREATE TABLE" ${backupFile} ) -lt 200 || $( grep --count "PostgreSQL database dump complete" ${backupFile} ) -eq 0 ]]; then + echo "ERROR: backup verification FAILED" + echo "ERROR: $(tail ${backupFile})" + exit 1 +fi + +gzip ${backupFile} + + +echo "completed backup of $container for $project to ${backupFile}" +
--- a/scripts/backup-usas.sh Fri Jun 16 17:14:15 2017 +0100 +++ b/scripts/backup-usas.sh Tue Aug 15 21:59:23 2017 +0100 @@ -1,6 +1,5 @@ #!/bin/bash - docker-compose run --rm usasdb sh -c \ - "pg_dump -Cc --if-exists --host=usasdb \ - --dbname=\$USASDB_ENV_DB_NAME \ - --username=\$USASDB_ENV_DB_USER | gzip \ - > /backup/\$USASDB_ENV_DB_NAME.$(date +%Y-%m-%d-%H-%M-%S).backup.gz" +source "${SSDT_SCRIPTS:-$(dirname "${BASH_SOURCE[0]}")}/.functions.sh" + +${SSDT_SCRIPTS}/backup-container.sh usasdb +
--- a/scripts/backup-usps.sh Fri Jun 16 17:14:15 2017 +0100 +++ b/scripts/backup-usps.sh Tue Aug 15 21:59:23 2017 +0100 @@ -1,6 +1,6 @@ #!/bin/bash - docker-compose run --rm uspsdb sh -c \ - "pg_dump -Cc --if-exists --host=uspsdb \ - --dbname=\$USPSDB_ENV_DB_NAME \ - --username=\$USPSDB_ENV_DB_USER | gzip \ - > /backup/\$USPSDB_ENV_DB_NAME.$(date +%Y-%m-%d-%H-%M-%S).backup.gz" + +source "${SSDT_SCRIPTS:-$(dirname "${BASH_SOURCE[0]}")}/.functions.sh" + +${SSDT_SCRIPTS}/backup-container.sh uspsdb +
--- a/scripts/capture.sh Fri Jun 16 17:14:15 2017 +0100 +++ b/scripts/capture.sh Tue Aug 15 21:59:23 2017 +0100 @@ -1,3 +1,4 @@ #!/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} +# current logs to standard out from container (all containers by default) in current project +docker-compose logs --no-color $1 +
--- a/scripts/console.sh Fri Jun 16 17:14:15 2017 +0100 +++ b/scripts/console.sh Tue Aug 15 21:59:23 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
--- a/scripts/info.sh Fri Jun 16 17:14:15 2017 +0100 +++ b/scripts/info.sh Tue Aug 15 21:59:23 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 -
--- a/scripts/send.sh Fri Jun 16 17:14:15 2017 +0100 +++ b/scripts/send.sh Tue Aug 15 21:59:23 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
--- a/scripts/updates-pull.sh Fri Jun 16 17:14:15 2017 +0100 +++ b/scripts/updates-pull.sh Tue Aug 15 21:59:23 2017 +0100 @@ -18,7 +18,7 @@ do repo=${line[0]} tag=${line[1]} - if [[ $repo == docker.ssdt.io* ]] + if [[ $repo == docker.ssdt.io* && $tag != *none* ]] then echo "docker pull ${repo}:${tag}" docker pull ${repo}:${tag}
--- a/tomcat/Dockerfile Fri Jun 16 17:14:15 2017 +0100 +++ b/tomcat/Dockerfile Tue Aug 15 21:59:23 2017 +0100 @@ -1,11 +1,21 @@ -FROM tomcat:8.5.5-jre8 +FROM tomcat:8.5.14-jre8 MAINTAINER Dave Smith <smith@nwoca.org> -RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections \ - && echo 'deb http://httpredir.debian.org/debian jessie contrib' > /etc/apt/sources.list.d/jessie-contrib.list \ - && apt-get update \ - && apt-get install -y ttf-mscorefonts-installer +RUN echo "deb http://httpredir.debian.org/debian jessie main contrib" > /etc/apt/sources.list \ + && echo "deb http://security.debian.org/ jessie/updates main contrib" >> /etc/apt/sources.list \ + && echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections \ + && apt-get update \ + && apt-get install -y ttf-mscorefonts-installer \ + && apt-get clean \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* + +RUN apt-get update \ + && apt-get install -y postgresql-client \ + && apt-get clean \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* WORKDIR /usr/local/tomcat @@ -16,7 +26,3 @@ && chmod +x bin/setenv.sh ENV TZ=America/New_York - -ENV LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/usr/lib/x86_64-linux-gnu/ - -RUN apt-get install -y libtcnative-1
--- a/tomcat/tomcat-users.xml Fri Jun 16 17:14:15 2017 +0100 +++ b/tomcat/tomcat-users.xml Tue Aug 15 21:59:23 2017 +0100 @@ -5,5 +5,7 @@ version="1.0"> <role rolename="manager-gui"/> <role rolename="manager-jmx"/> + <role rolename="manager-script"/> <user username="admin" password="99admin00" roles="manager-gui,manager-jmx"/> + <user username="script" password="99admin00" roles="manager-script"/> </tomcat-users> \ No newline at end of file