diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1d4fa31 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,53 @@ +FROM debian:buster-slim + +ENV BUILD_DEPS \ + curl \ + gcc \ + gcc-multilib \ + make \ + ruby-dev \ + xz-utils + +ENV RUN_DEPS \ + dos2unix \ + file \ + git \ + moreutils \ + php-cli \ + python \ + ruby \ + shellcheck + +RUN set -x \ +# Install apt packages + && apt-get update \ + && apt-get install --no-install-recommends --no-install-suggests -y \ + ${BUILD_DEPS} \ + ${RUN_DEPS} \ +# Install Node/Npm + && VERSION="$( curl https://nodejs.org/en/ 2>/dev/null | grep LTS | grep -Eo 'data-version="v?[.0-9]+"' | grep -Eo "v?[.0-9]+" )" \ + && mkdir -p /usr/local/src \ + && curl https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz > /usr/local/src/node.tar.xz \ + && tar xvf /usr/local/src/node.tar.xz -C /usr/local/src \ + && rm -rf /usr/local/src/node.tar.xz \ + && rm -rf /usr/local/src/node-${VERSION}-linux-x64/etc \ + && rm -rf /usr/local/src/node-${VERSION}-linux-x64/include \ + && rm -rf /usr/local/src/node-${VERSION}-linux-x64/share \ + && ln -sf /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node \ + && ln -sf /usr/local/node/bin/* /usr/local/bin/ \ +# Install Npm modules + && npm install -g eslint \ + && npm install -g mdlint \ + && npm install -g jsonlint \ + && ln -sf /usr/local/node/bin/* /usr/local/bin/ \ +# Install Gems + && gem install scss_lint \ + && gem install mdl \ +# Clean-up + && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $fetchDeps \ + ${BUILD_DEPS} \ + && rm -rf /var/lib/apt/lists/* + +# Add Awesome-CI +COPY ./bin /usr/bin +COPY ./dependencies /usr/bin diff --git a/Makefile b/Makefile index f89c2d3..531dfd6 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,14 @@ -# Unix Makefile - -# Configuration +### +### Variables +### SHELL = /bin/sh MKDIR_P = mkdir -p -# Check if './configure' has been run -ifneq ("$(wildcard configure.in)","") -CONFIGURED = 1 -include configure.in -else -CONFIGURED = 0 -endif - - -all: - -ifeq ($(CONFIGURED),0) -$(error Not configured, run ./configure) -endif - - - @echo "Nothing to make." - @echo "Type 'make install'" - +### +### Help +### help: @echo Options @echo " make install" @@ -33,12 +17,21 @@ help: @echo " make clean" @echo " Clean build" @echo "" + @echo " make docker" + @echo " Build docker image" + @echo "" @echo " make help" @echo " Show this help screen" +### +### Install +### install: - +ifeq ("$(wildcard configure.in)","") + $(error Not configured, run ./configure) + false +endif @echo "Installing files" @echo "" @@ -56,6 +49,15 @@ install: @echo "" +### +### Clean +### clean: - rm -f configure.in + + +### +### Build docker image +### +docker: + docker build -t cytopia/awesome-ci . diff --git a/README.md b/README.md index b282aea..a0a5916 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # awesome-ci [![Build Status](https://travis-ci.org/cytopia/awesome-ci.svg?branch=master)](https://travis-ci.org/cytopia/awesome-ci) -[![Latest Stable Version](https://poser.pugx.org/cytopia/awesome-ci/v/stable)](https://packagist.org/packages/cytopia/awesome-ci) [![Total Downloads](https://poser.pugx.org/cytopia/awesome-ci/downloads)](https://packagist.org/packages/cytopia/awesome-ci) [![Latest Unstable Version](https://poser.pugx.org/cytopia/awesome-ci/v/unstable)](https://packagist.org/packages/cytopia/awesome-ci) [![License](https://poser.pugx.org/cytopia/awesome-ci/license)](http://opensource.org/licenses/MIT) +[![Latest Stable Version](https://poser.pugx.org/cytopia/awesome-ci/v/stable)](https://packagist.org/packages/cytopia/awesome-ci) +[![Total Downloads](https://poser.pugx.org/cytopia/awesome-ci/downloads)](https://packagist.org/packages/cytopia/awesome-ci) +[![License](https://poser.pugx.org/cytopia/awesome-ci/license)](http://opensource.org/licenses/MIT) [![Type](https://img.shields.io/badge/type-bash-red.svg)](https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29) --- @@ -23,6 +25,20 @@ Lot's of tools for git, file and static source code analysis. --- +**Table of Contents** + +1. [Tools](#tools) +2. [Learn / Validate](#learn--validate) +3. [Fix](#fix) +4. [Custom regex contributions](#custom-regex-contributions) +5. [General usage](#general-usage) +6. [Installation](i#installation) + 1. [Install OSX](#install-osx) + 2. [Install Linux/BSD](#install-linuxbsd) +7. [Awesome CI Docker image](#awesome-ci-docker-image) +8. [License](#license) + + ## Tools All checks have the option to only check by one or more file **extensions**, by **shebang** as well as to **exclude** one or more folders from the whole search. @@ -131,7 +147,6 @@ Please use pull requests to add useful checks. --version # Show tool version ``` - ## Installation ### Install OSX @@ -157,9 +172,17 @@ make install make install ``` +## Awesome CI Docker image + +Instead of installing it, you can also use the bundled Docker image: +**[cytopia/awesome-ci](https://hub.docker.com/r/cytopia/awesome-ci/)** + +```bash +docker run -v ${PWD}:/ac cytopia/awesome-ci file-crlf --path=/ac +``` ## License [MIT License](LICENSE.md) -Copyright (c) 2016 [cytopia](https://github.com/cytopia) +Copyright (c) 2018 [cytopia](https://github.com/cytopia)