├── update.php ├── config └── exakat.ini ├── README.md ├── exakat.sh └── Dockerfile /update.php: -------------------------------------------------------------------------------- 1 | $version\n"; 16 | 17 | $php = str_replace($old, $version, $php); 18 | file_put_contents('Dockerfile', $php); 19 | 20 | 21 | $md = file_get_contents('README.md'); 22 | $md = str_replace($old, $version, $md); 23 | 24 | file_put_contents('README.md', $md); 25 | 26 | #shell_exec('git stage Dockerfile README.md; git commit -m "Update to version '.$version.' "; git push -u exakatGithub'); 27 | 28 | 29 | 30 | ?> -------------------------------------------------------------------------------- /config/exakat.ini: -------------------------------------------------------------------------------- 1 | graphdb = 'gsneo4j'; 2 | 3 | ; where is neo4j inside a gremlin server host 4 | gsneo4j_host = '127.0.0.1'; 5 | gsneo4j_port = '8182'; 6 | gsneo4j_folder = 'tinkergraph'; 7 | 8 | tinkergraph_host = '127.0.0.1'; 9 | tinkergraph_port = '8182'; 10 | tinkergraph_folder = 'tinkergraph'; 11 | 12 | ;phpversion = 7.4 13 | 14 | php74 = /usr/local/bin/php 15 | 16 | token_limit = 100000000 17 | 18 | ; Default themes to run 19 | project_rulesets[] = 'CompatibilityPHP53'; 20 | project_rulesets[] = 'CompatibilityPHP54'; 21 | project_rulesets[] = 'CompatibilityPHP55'; 22 | project_rulesets[] = 'CompatibilityPHP56'; 23 | project_rulesets[] = 'CompatibilityPHP70'; 24 | project_rulesets[] = 'CompatibilityPHP71'; 25 | project_rulesets[] = 'CompatibilityPHP72'; 26 | project_rulesets[] = 'CompatibilityPHP73'; 27 | project_rulesets[] = 'CompatibilityPHP74'; 28 | project_rulesets[] = 'CompatibilityPHP80'; 29 | project_rulesets[] = 'Analyze'; 30 | project_rulesets[] = 'Preferences'; 31 | project_rulesets[] = 'Appinfo'; 32 | project_rulesets[] = 'Appcontent'; 33 | project_rulesets[] = 'Dead code'; 34 | project_rulesets[] = 'ClassReview'; 35 | project_rulesets[] = 'Performances'; 36 | project_rulesets[] = 'Security'; 37 | project_rulesets[] = 'Custom'; 38 | project_rulesets[] = 'Inventory'; 39 | project_rulesets[] = 'Stats'; 40 | project_rulesets[] = 'php-cs-fixable'; 41 | project_rulesets[] = 'Rector'; 42 | 43 | ; Default reports to generate 44 | project_reports[] = 'Ambassador'; 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Exakat Docker Container 2 | 3 | [Docker](https://www.docker.com) container and run [Exakat](https://www.exakat.io/) 2.4.0. 4 | 5 | ## Features 6 | 7 | * [Exakat](https://www.exakat.io/) [`2.4.0`](https://github.com/exakat/exakat-ce.git) 8 | * [PHP](https://php.net) 8.1 or 8.0 9 | * [Gremlin Server 3.4.13](http://tinkerpop.apache.org/) 10 | * VCS 11 | * [Git](https://git-scm.com/) 12 | * [Mercurial](https://www.mercurial-scm.org/) 13 | * [Composer](https://getcomposer.org/) 14 | * [Bazaar](http://bazaar.canonical.com/en/) 15 | * [SVN](https://subversion.apache.org/). 16 | * [zip] 17 | 18 | ## Tags 19 | 20 | 21 | 22 | ## Installation 23 | 24 | 1. Install the exakat/exakat container: 25 | 26 | ``` sh 27 | $ docker pull exakat/exakat 28 | ``` 29 | 30 | 2. Run Exakat: 31 | 32 | ``` sh 33 | $ docker run -v $(pwd)/projects:/usr/src/exakat/projects --rm exakat/exakat exakat 34 | ``` 35 | 36 | 3. Make commandline short cut for Exakat : 37 | 38 | ``` sh 39 | $ echo "#\!/bin/bash\ndocker run -it -v \$(pwd)/projects:/usr/src/exakat/projects --rm --name my-exakat exakat/exakat exakat \$@" > /usr/local/bin/exakat 40 | $ chmod u+x /usr/local/bin/exakat 41 | $ exakat version 42 | ``` 43 | 44 | ## Dockerfile building 45 | 46 | To build the Exakat dockerfile : 47 | 48 | 1. Clone the source: 49 | 50 | ``` sh 51 | $ git clone https://github.com/exakat/exakat-docker.git 52 | $ cd exakat-docker 53 | ``` 54 | 55 | 2. Build the container: 56 | 57 | ``` sh 58 | $ docker build --no-cache -t exakat/exakat:2.1.9 . 59 | ``` 60 | 61 | 4. Test the Exakat container: 62 | 63 | ``` sh 64 | $ docker run -it -v $(pwd):/usr/src/exakat/projects --rm exakat/exakat exakat doctor 65 | $ docker run -it -v $(pwd):/usr/src/exakat/projects --rm exakat/exakat exakat init -p nlptools -R https://github.com/atrilla/nlptools.git -v 66 | $ docker run -it -v $(pwd):/usr/src/exakat/projects --rm exakat/exakat exakat project -v -p nlptools 67 | ``` 68 | -------------------------------------------------------------------------------- /exakat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -le 0 ]; then 4 | ./exakat version 5 | exit 0 6 | fi 7 | 8 | # Option defaults 9 | URL="" 10 | format="Diplomat" 11 | 12 | # getopts string 13 | # This string needs to be updated with the single character options (e.g. -f) 14 | opts="p:R:f:" 15 | 16 | # Gets the command name without path 17 | cmd(){ echo `basename $0`; } 18 | 19 | # Help command output 20 | usage(){ 21 | echo "\ 22 | `cmd` [OPTION...] 23 | -p; project name 24 | -R; URL of the repository 25 | -f, --format; audit output 26 | " | column -t -s ";" 27 | } 28 | 29 | # Error message 30 | error(){ 31 | echo "`cmd`: invalid option -- '$1'"; 32 | echo "Try '`cmd` -h' for more information."; 33 | exit 1; 34 | } 35 | 36 | command=$1; 37 | shift 1; 38 | 39 | if [ "$command" != "project" ]; then 40 | ./exakat $command $@ 41 | exit 0 42 | fi 43 | 44 | # There's two passes here. The first pass handles the long options and 45 | # any short option that is already in canonical form. The second pass 46 | # uses `getopt` to canonicalize any remaining short options and handle 47 | # them 48 | for pass in 1 2; do 49 | while [ -n "$1" ]; do 50 | case $1 in 51 | --) shift; break;; 52 | -*) case $1 in 53 | -R) URL=$2; shift;; 54 | -p) project=$2; shift;; 55 | -f|--format) format=$2; shift;; 56 | --*) error $1;; 57 | -*) if [ $pass -eq 1 ]; then ARGS="$ARGS $1"; 58 | else error $1; fi;; 59 | esac;; 60 | *) if [ $pass -eq 1 ]; then ARGS="$ARGS $1"; 61 | else error $1; fi;; 62 | esac 63 | shift 64 | done 65 | if [ $pass -eq 1 ]; then ARGS=`getopt $opts $ARGS` 66 | if [ $? != 0 ]; then usage; exit 2; fi; set -- $ARGS 67 | fi 68 | done 69 | 70 | # Handle positional arguments 71 | if [ -n "$*" ]; then 72 | echo "`cmd`: Extra arguments -- $*" 73 | echo "Try '`cmd` -h' for more information." 74 | exit 1 75 | fi 76 | 77 | if [ ! -f "./projects/$project" ]; then 78 | if [ ! -z "$URL" ]; then 79 | ./exakat init -p $project -R $URL 80 | fi 81 | fi 82 | 83 | exakat project -p $project --format $format 84 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.1-cli-buster 2 | 3 | LABEL MAINTAINER Exakat, Damien Seguy, dseguy@exakat.io 4 | ENV EXAKAT_VERSION 2.4.0 5 | ENV GREMLIN_VERSION 3.4.13 6 | ENV TZ=Europe/Paris 7 | 8 | ENV PATH="/usr/src/exakat/:${PATH}" 9 | 10 | COPY config/exakat.ini /usr/src/exakat/config/ 11 | 12 | RUN \ 13 | echo "====> Exakat $EXAKAT_VERSION" && \ 14 | mkdir -p /usr/src/exakat && \ 15 | cd /usr/src/exakat && \ 16 | \ 17 | echo "===> php.ini" && \ 18 | echo "memory_limit=-1" >> /usr/local/etc/php/php.ini && \ 19 | echo "zend.assertions=-1" >> /usr/local/etc/php/php.ini && \ 20 | \ 21 | echo "===> Java 8" && \ 22 | mkdir -p /usr/share/man/man1 && \ 23 | apt-get update && \ 24 | apt-get install -y default-jre && \ 25 | \ 26 | apt-get install -y --no-install-recommends procps git subversion mercurial bzr lsof unzip zip && \ 27 | \ 28 | echo "===> Composer" && \ 29 | curl -sS https://getcomposer.org/installer -o composer-setup.php && \ 30 | HASH="$(curl --silent -o - https://composer.github.io/installer.sig)" && \ 31 | php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \ 32 | php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \ 33 | \ 34 | echo "====> Gremlin-Server" && \ 35 | curl --silent -o apache-tinkerpop-gremlin-server-$GREMLIN_VERSION-bin.zip https://www.exakat.io/versions/apache-tinkerpop-gremlin-server-$GREMLIN_VERSION-bin.zip && \ 36 | unzip apache-tinkerpop-gremlin-server-$GREMLIN_VERSION-bin.zip && \ 37 | mv apache-tinkerpop-gremlin-server-$GREMLIN_VERSION tinkergraph && \ 38 | rm -rf apache-tinkerpop-gremlin-server-$GREMLIN_VERSION-bin.zip && \ 39 | cd tinkergraph && \ 40 | bin/gremlin-server.sh install org.apache.tinkerpop neo4j-gremlin $GREMLIN_VERSION && \ 41 | rm -rf javadocs && \ 42 | rm -rf data && \ 43 | rm -rf docs && \ 44 | rm -rf licences && \ 45 | cd .. && \ 46 | \ 47 | echo "====> Exakat $EXAKAT_VERSION" && \ 48 | cd /usr/src/exakat && \ 49 | curl --silent https://www.exakat.io/versions/index.php?file=exakat-$EXAKAT_VERSION.phar -o exakat && \ 50 | chmod a+x /usr/src/exakat/exakat && \ 51 | \ 52 | echo "====> Cleanup" && \ 53 | \ 54 | apt-get clean && \ 55 | rm -rf /var/cache/oracle-jdk8-installer && \ 56 | rm -rf /var/lib/apt/lists/* && \ 57 | exakat doctor 58 | 59 | CMD [ "exakat", "doctor" ] 60 | --------------------------------------------------------------------------------