Skip to content

Commit

Permalink
Add Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Jun 11, 2018
1 parent 3047814 commit 5a222d2
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 27 deletions.
53 changes: 53 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
50 changes: 26 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 ""
Expand All @@ -56,6 +49,15 @@ install:
@echo ""


###
### Clean
###
clean:

rm -f configure.in


###
### Build docker image
###
docker:
docker build -t cytopia/awesome-ci .
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

---
Expand All @@ -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.
Expand Down Expand Up @@ -131,7 +147,6 @@ Please use pull requests to add useful checks.
--version # Show tool version
```


## Installation

### Install OSX
Expand All @@ -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)

0 comments on commit 5a222d2

Please sign in to comment.