diff --git a/.travis.yml b/.travis.yml index be166146d0c5..123994c1745d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,13 @@ -language: go - -sudo: false +language: bash +services: docker install: - - .travis/get-markdownfmt.sh + - docker pull tianon/markdownfmt + - docker pull tianon/ymlfmt script: - .travis/check-markdownfmt.sh + - .travis/check-ymlfmt.sh - .travis/check-short.sh - .travis/check-required-files.sh - .travis/check-pr-no-readme.sh diff --git a/.travis/check-markdownfmt.sh b/.travis/check-markdownfmt.sh index 82f2f11f92b3..142c4afc3918 100755 --- a/.travis/check-markdownfmt.sh +++ b/.travis/check-markdownfmt.sh @@ -8,11 +8,11 @@ files="$( -name '*.md' \ -not -name 'README.md' \ \) -exec test -s '{}' ';' -print0 \ - | xargs -0 markdownfmt -l)" + | xargs -0 ./markdownfmt.sh -l)" if [ "$files" ]; then echo >&2 'Need markdownfmt:' echo >&2 "$files" echo >&2 - echo "$files" | xargs markdownfmt -d >&2 + echo "$files" | xargs ./markdownfmt.sh -d >&2 exit 1 fi diff --git a/.travis/check-ymlfmt.sh b/.travis/check-ymlfmt.sh new file mode 100755 index 000000000000..82cffb1d08f2 --- /dev/null +++ b/.travis/check-ymlfmt.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." + +files="$(find -name '*.yml')" +need=() +needdiff= +for f in $files; do + fdiff="$(./ymlfmt.sh -d "$f")" + if [ -n "$fdiff" ]; then + need+=( "$f" ) + needdiff+="$fdiff"$'\n' + fi +done +if [ -n "$needdiff" ]; then + echo >&2 'Need ymlfmt:' + echo >&2 "${need[@]}" + echo >&2 + echo >&2 -n "$needdiff" + exit 1 +fi diff --git a/adminer/stack.yml b/adminer/stack.yml index 89178f6025f4..56aa33b59f26 100644 --- a/adminer/stack.yml +++ b/adminer/stack.yml @@ -4,14 +4,14 @@ version: '3.1' services: - adminer: - image: adminer - restart: always - ports: - - 8080:8080 + adminer: + image: adminer + restart: always + ports: + - 8080:8080 - db: - image: mysql:5.6 - restart: always - environment: - MYSQL_ROOT_PASSWORD: example + db: + image: mysql:5.6 + restart: always + environment: + MYSQL_ROOT_PASSWORD: example diff --git a/bonita/stack.yml b/bonita/stack.yml index 23960027f88c..6d3279428559 100644 --- a/bonita/stack.yml +++ b/bonita/stack.yml @@ -2,43 +2,43 @@ version: '3' services: - db: - image: postgres:9.3 - environment: - POSTGRES_PASSWORD: example - restart: always - command: - - -c - - max_prepared_transactions=100 - bonita: - image: bonita - ports: - - 8080:8080 - environment: - - POSTGRES_ENV_POSTGRES_PASSWORD=example - - DB_VENDOR=postgres - - DB_HOST=db - - TENANT_LOGIN=tech_user - - TENANT_PASSWORD=secret - - PLATFORM_LOGIN=pfadmin - - PLATFORM_PASSWORD=pfsecret - restart: always - depends_on: - - db - entrypoint: - - bash - - -c - - | - set -e - echo 'Waiting for Postgres to be available' - export PGPASSWORD="$$POSTGRES_ENV_POSTGRES_PASSWORD" - maxTries=10 - while [ "$$maxTries" -gt 0 ] && ! psql -h "$$DB_HOST" -U 'postgres' -c '\l'; do - sleep 1 - done - echo - if [ "$$maxTries" -le 0 ]; then - echo >&2 'error: unable to contact Postgres after 10 tries' - exit 1 - fi - exec /opt/files/startup.sh + db: + image: postgres:9.3 + environment: + POSTGRES_PASSWORD: example + restart: always + command: + - -c + - max_prepared_transactions=100 + bonita: + image: bonita + ports: + - 8080:8080 + environment: + - POSTGRES_ENV_POSTGRES_PASSWORD=example + - DB_VENDOR=postgres + - DB_HOST=db + - TENANT_LOGIN=tech_user + - TENANT_PASSWORD=secret + - PLATFORM_LOGIN=pfadmin + - PLATFORM_PASSWORD=pfsecret + restart: always + depends_on: + - db + entrypoint: + - bash + - -c + - | + set -e + echo 'Waiting for Postgres to be available' + export PGPASSWORD="$$POSTGRES_ENV_POSTGRES_PASSWORD" + maxTries=10 + while [ "$$maxTries" -gt 0 ] && ! psql -h "$$DB_HOST" -U 'postgres' -c '\l'; do + sleep 1 + done + echo + if [ "$$maxTries" -le 0 ]; then + echo >&2 'error: unable to contact Postgres after 10 tries' + exit 1 + fi + exec /opt/files/startup.sh diff --git a/elasticsearch/stack.yml b/elasticsearch/stack.yml index 1f7a01f820a4..ea77eb1a355c 100644 --- a/elasticsearch/stack.yml +++ b/elasticsearch/stack.yml @@ -2,10 +2,10 @@ version: '3.1' services: - elasticsearch: - image: elasticsearch + elasticsearch: + image: elasticsearch - kibana: - image: kibana - ports: - - 5601:5601 + kibana: + image: kibana + ports: + - 5601:5601 diff --git a/geonetwork/stack.yml b/geonetwork/stack.yml index c080243e84a0..0be0b317b9f4 100644 --- a/geonetwork/stack.yml +++ b/geonetwork/stack.yml @@ -8,15 +8,15 @@ version: '3.1' services: - geonetwork: - image: geonetwork - restart: always - ports: - - 8080:8080 - environment: - DATA_DIR: /var/lib/geonetwork_data - volumes: - - geonetwork:/var/lib/geonetwork_data + geonetwork: + image: geonetwork + restart: always + ports: + - 8080:8080 + environment: + DATA_DIR: /var/lib/geonetwork_data + volumes: + - geonetwork:/var/lib/geonetwork_data volumes: - geonetwork: + geonetwork: diff --git a/joomla/stack.yml b/joomla/stack.yml index ea3956385882..f1ac990db505 100644 --- a/joomla/stack.yml +++ b/joomla/stack.yml @@ -1,19 +1,19 @@ version: '3.1' services: - joomla: - image: joomla - restart: always - links: - - joomladb:mysql - ports: - - 8080:80 - environment: - JOOMLA_DB_HOST: joomladb - JOOMLA_DB_PASSWORD: example + joomla: + image: joomla + restart: always + links: + - joomladb:mysql + ports: + - 8080:80 + environment: + JOOMLA_DB_HOST: joomladb + JOOMLA_DB_PASSWORD: example - joomladb: - image: mysql:5.6 - restart: always - environment: - MYSQL_ROOT_PASSWORD: example + joomladb: + image: mysql:5.6 + restart: always + environment: + MYSQL_ROOT_PASSWORD: example diff --git a/kibana/stack.yml b/kibana/stack.yml index 210aba229f9a..a1139cb266e9 100644 --- a/kibana/stack.yml +++ b/kibana/stack.yml @@ -2,11 +2,11 @@ version: '3.1' services: - kibana: - image: kibana - ports: - - 5601:5601 + kibana: + image: kibana + ports: + - 5601:5601 - elasticsearch: - image: elasticsearch + elasticsearch: + image: elasticsearch diff --git a/mariadb/stack.yml b/mariadb/stack.yml index 849dcb700bfd..f03f742cd8b4 100644 --- a/mariadb/stack.yml +++ b/mariadb/stack.yml @@ -3,14 +3,14 @@ version: '3.1' services: - db: - image: mariadb - restart: always - environment: - MYSQL_ROOT_PASSWORD: example + db: + image: mariadb + restart: always + environment: + MYSQL_ROOT_PASSWORD: example - adminer: - image: adminer - restart: always - ports: - - 8080:8080 + adminer: + image: adminer + restart: always + ports: + - 8080:8080 diff --git a/markdownfmt.sh b/markdownfmt.sh index c0a99ae0a40b..43eb694c2fb8 100755 --- a/markdownfmt.sh +++ b/markdownfmt.sh @@ -1,4 +1,4 @@ #!/bin/bash set -e -exec docker run -i --rm -v "$PWD":/scratch -w /scratch tianon/markdownfmt markdownfmt "$@" +exec docker run -i --rm -v "$PWD":/scratch -w /scratch -u "$(id -u):$(id -g)" tianon/markdownfmt markdownfmt "$@" diff --git a/mediawiki/stack.yml b/mediawiki/stack.yml index 035785ca3191..84e79c4f5472 100644 --- a/mediawiki/stack.yml +++ b/mediawiki/stack.yml @@ -22,7 +22,7 @@ services: restart: always environment: # @see https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/DefaultSettings.php - MYSQL_DATABASE: 'my_wiki' - MYSQL_USER: 'wikiuser' - MYSQL_PASSWORD: 'example' - MYSQL_RANDOM_ROOT_PASSWORD: 'yes' + MYSQL_DATABASE: my_wiki + MYSQL_USER: wikiuser + MYSQL_PASSWORD: example + MYSQL_RANDOM_ROOT_PASSWORD: yes diff --git a/mysql/stack.yml b/mysql/stack.yml index 3f46e8249107..4fb505661b11 100644 --- a/mysql/stack.yml +++ b/mysql/stack.yml @@ -3,14 +3,14 @@ version: '3.1' services: - db: - image: mysql - restart: always - environment: - MYSQL_ROOT_PASSWORD: example + db: + image: mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: example - adminer: - image: adminer - restart: always - ports: - - 8080:8080 + adminer: + image: adminer + restart: always + ports: + - 8080:8080 diff --git a/percona/stack.yml b/percona/stack.yml index ff4fc749e417..9390e2f93a4a 100644 --- a/percona/stack.yml +++ b/percona/stack.yml @@ -3,14 +3,14 @@ version: '3.1' services: - db: - image: percona - restart: always - environment: - MYSQL_ROOT_PASSWORD: example + db: + image: percona + restart: always + environment: + MYSQL_ROOT_PASSWORD: example - adminer: - image: adminer - restart: always - ports: - - 8080:8080 + adminer: + image: adminer + restart: always + ports: + - 8080:8080 diff --git a/postgres/stack.yml b/postgres/stack.yml index c58347ed900e..3994b0c470c2 100644 --- a/postgres/stack.yml +++ b/postgres/stack.yml @@ -3,14 +3,14 @@ version: '3.1' services: - db: - image: postgres - restart: always - environment: - POSTGRES_PASSWORD: example + db: + image: postgres + restart: always + environment: + POSTGRES_PASSWORD: example - adminer: - image: adminer - restart: always - ports: - - 8080:8080 + adminer: + image: adminer + restart: always + ports: + - 8080:8080 diff --git a/storm/stack.yml b/storm/stack.yml index 14b58a30f795..a1da43b6efa6 100644 --- a/storm/stack.yml +++ b/storm/stack.yml @@ -1,31 +1,31 @@ version: '3.1' services: - zookeeper: - image: zookeeper - container_name: zookeeper - restart: always + zookeeper: + image: zookeeper + container_name: zookeeper + restart: always - nimbus: - image: storm - container_name: nimbus - command: storm nimbus - depends_on: - - zookeeper - links: - - zookeeper - restart: always - ports: - - 6627:6627 + nimbus: + image: storm + container_name: nimbus + command: storm nimbus + depends_on: + - zookeeper + links: + - zookeeper + restart: always + ports: + - 6627:6627 - supervisor: - image: storm - container_name: supervisor - command: storm supervisor - depends_on: - - nimbus - - zookeeper - links: - - nimbus - - zookeeper - restart: always + supervisor: + image: storm + container_name: supervisor + command: storm supervisor + depends_on: + - nimbus + - zookeeper + links: + - nimbus + - zookeeper + restart: always diff --git a/ymlfmt.sh b/ymlfmt.sh new file mode 100755 index 000000000000..a83bbeb4c2d9 --- /dev/null +++ b/ymlfmt.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -e + +exec docker run -i --rm -v "$PWD":/scratch -w /scratch -u "$(id -u):$(id -g)" tianon/ymlfmt ymlfmt "$@" diff --git a/zookeeper/stack.yml b/zookeeper/stack.yml index 66771ced379e..9a34e7d38f7c 100644 --- a/zookeeper/stack.yml +++ b/zookeeper/stack.yml @@ -1,32 +1,32 @@ version: '3.1' services: - zoo1: - image: zookeeper - restart: always - hostname: zoo1 - ports: - - 2181:2181 - environment: - ZOO_MY_ID: 1 - ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 + zoo1: + image: zookeeper + restart: always + hostname: zoo1 + ports: + - 2181:2181 + environment: + ZOO_MY_ID: 1 + ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 - zoo2: - image: zookeeper - restart: always - hostname: zoo2 - ports: - - 2182:2181 - environment: - ZOO_MY_ID: 2 - ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 + zoo2: + image: zookeeper + restart: always + hostname: zoo2 + ports: + - 2182:2181 + environment: + ZOO_MY_ID: 2 + ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 - zoo3: - image: zookeeper - restart: always - hostname: zoo3 - ports: - - 2183:2181 - environment: - ZOO_MY_ID: 3 - ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 + zoo3: + image: zookeeper + restart: always + hostname: zoo3 + ports: + - 2183:2181 + environment: + ZOO_MY_ID: 3 + ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888