diff --git a/.travis.yml b/.travis.yml index 0a8763a..1be24fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ sudo: required ### ### Language ### -language: python +language: minimal ### @@ -40,19 +40,24 @@ env: ### Install requirements ### install: - # Get newer docker version - - while ! sudo apt-get update; do sleep 1; done - - while ! sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce; do sleep 1; done - - docker version + - retry() { + for ((n=0; n<10; n++)); do + echo "[${n}] ${*}"; + if eval "${*}"; then + return 0; + fi; + done; + return 1; + } ### ### Check generation changes, build and test ### before_script: - - make lint - - while ! make build TAG=${VERSION}; do sleep 1; done - - while ! make test TAG=${VERSION}; do sleep 1; done + - retry make lint + - retry make build TAG=${VERSION} + - retry make test TAG=${VERSION} ### diff --git a/Makefile b/Makefile index 1abda25..7cbda97 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ ifneq (,) .error This Makefile requires GNU Make. endif -.PHONY: build rebuild lint test _test_version _test_run tag pull login push enter +.PHONY: build rebuild lint test _test-version _test-run tag pull login push enter CURRENT_DIR = $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) @@ -26,10 +26,10 @@ lint: @docker run --rm -v $(CURRENT_DIR):/data cytopia/file-lint file-utf8-bom --text --ignore '.git/,.github/,tests/' --path . test: - @$(MAKE) --no-print-directory _test_version - @$(MAKE) --no-print-directory _test_run + @$(MAKE) --no-print-directory _test-version + @$(MAKE) --no-print-directory _test-run -_test_version: +_test-version: @echo "------------------------------------------------------------" @echo "- Testing correct version" @echo "------------------------------------------------------------" @@ -56,7 +56,7 @@ _test_version: fi; \ echo "Success"; \ -_test_run: +_test-run: @echo "------------------------------------------------------------" @echo "- Testing playbook" @echo "------------------------------------------------------------" diff --git a/README.md b/README.md index 32485df..3c4ca76 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,17 @@ > [eslint](https://github.com/cytopia/docker-eslint) **•** > [file-lint](https://github.com/cytopia/docker-file-lint) **•** > [gofmt](https://github.com/cytopia/docker-gofmt) **•** +> [goimports](https://github.com/cytopia/docker-goimports) **•** > [golint](https://github.com/cytopia/docker-golint) **•** > [jsonlint](https://github.com/cytopia/docker-jsonlint) **•** +> [phpcbf](https://github.com/cytopia/docker-phpcbf) **•** > [phpcs](https://github.com/cytopia/docker-phpcs) **•** +> [php-cs-fixer](https://github.com/cytopia/docker-php-cs-fixer) **•** > [pycodestyle](https://github.com/cytopia/docker-pycodestyle) **•** > [pylint](https://github.com/cytopia/docker-pylint) **•** > [terraform-docs](https://github.com/cytopia/docker-terraform-docs) **•** > [terragrunt](https://github.com/cytopia/docker-terragrunt) **•** +> [terragrunt-fmt](https://github.com/cytopia/docker-terragrunt-fmt) **•** > [yamllint](https://github.com/cytopia/docker-yamllint) @@ -31,7 +35,6 @@ > > Visit **[cytopia/makefiles](https://github.com/cytopia/makefiles)** for seamless project integration, minimum required best-practice code linting and CI. - View **[Dockerfile](https://github.com/cytopia/docker-jsonlint/blob/master/Dockerfile)** on GitHub. [![Docker hub](http://dockeri.co/image/cytopia/jsonlint?&kill_cache=1)](https://hub.docker.com/r/cytopia/jsonlint) @@ -117,20 +120,26 @@ linter below for reproducible local or remote CI tests: |--------------|------|-------------| | [awesome-ci](https://github.com/cytopia/awesome-ci) | Basic | Tools for git, file and static source code analysis | | [file-lint](https://github.com/cytopia/docker-file-lint) | Basic | Baisc source code analysis | -| [jsonlint](https://github.com/cytopia/docker-jsonlint) | Basic | Lint JSON files | +| [jsonlint](https://github.com/cytopia/docker-jsonlint) | Basic | Lint JSON files **[1]** | | [yamllint](https://github.com/cytopia/docker-yamllint) | Basic | Lint Yaml files | | [ansible](https://github.com/cytopia/docker-ansible) | Ansible | Multiple versoins of Ansible | | [ansible-lint](https://github.com/cytopia/docker-ansible-lint) | Ansible | Lint Ansible | -| [gofmt](https://github.com/cytopia/docker-gofmt) | Go | Format Go source code | +| [gofmt](https://github.com/cytopia/docker-gofmt) | Go | Format Go source code **[1]** | +| [goimports](https://github.com/cytopia/docker-goimports) | Go | Format Go source code **[1]** | | [golint](https://github.com/cytopia/docker-golint) | Go | Lint Go code | | [eslint](https://github.com/cytopia/docker-eslint) | Javascript | Lint Javascript code | | [checkmake](https://github.com/cytopia/docker-checkmake) | Make | Lint Makefiles | -| [phpcs](https://github.com/cytopia/docker-phpcs) | PHP | PHPCodeSniffer and Code Beautifier and Fixer | +| [phpcbf](https://github.com/cytopia/docker-phpcbf) | PHP | PHP Code Beautifier and Fixer | +| [phpcs](https://github.com/cytopia/docker-phpcs) | PHP | PHP Code Sniffer | +| [php-cs-fixer](https://github.com/cytopia/docker-php-cs-fixer) | PHP | PHP Coding Standards Fixer | | [black](https://github.com/cytopia/docker-black) | Python | The uncompromising Python code formatter | | [pycodestyle](https://github.com/cytopia/docker-pycodestyle) | Python | Python style guide checker | | [pylint](https://github.com/cytopia/docker-pylint) | Python | Python source code, bug and quality checker | -| [terraform-docs](https://github.com/cytopia/docker-terraform-docs) | Terraform | Terraform doc generator (TF 0.12 ready) | +| [terraform-docs](https://github.com/cytopia/docker-terraform-docs) | Terraform | Terraform doc generator (TF 0.12 ready) **[1]** | | [terragrunt](https://github.com/cytopia/docker-terragrunt) | Terraform | Terragrunt and Terraform | +| [terragrunt-fmt](https://github.com/cytopia/docker-terragrunt-fmt) | Terraform | `terraform fmt` for Terragrunt files **[1]** | + +> **[1]** Uses a shell wrapper to add **enhanced functionality** not available by original project. ### Makefiles diff --git a/data/docker-entrypoint.sh b/data/docker-entrypoint.sh index 5dc00be..2583b57 100755 --- a/data/docker-entrypoint.sh +++ b/data/docker-entrypoint.sh @@ -92,6 +92,7 @@ if [ "${#}" -gt "0" ]; then shift if [ "${#}" -lt "1" ]; then >&2 echo "Error, -t requires an argument" + exit 1 fi ARG_CHAR="-t '${1}'" shift @@ -101,6 +102,7 @@ if [ "${#}" -gt "0" ]; then shift if [ "${#}" -lt "1" ]; then >&2 echo "Error, -i requires an argument" + exit 1 fi ARG_IGNORE="${1}" shift