smontanari / code-forensics

A toolset for code analysis and report visualisation
384 stars 45 forks source link

added git as prerequisite to readme - fix for #25 #26

Closed gernotstarke closed 6 years ago

gernotstarke commented 6 years ago

gulp complains about missing git, when called with "list-analysis-tasks". Tried with the following:

Dockerfile:

FROM anapsix/alpine-java:8_jdk

ENV JAVA_HOME /opt/jdk
ENV PATH ${PATH}:${JAVA_HOME}/bin

RUN apk update && \
    apk add --update nodejs nodejs-npm && \
    # chmod a+rw ./package.json && \
    npm outdated && \
    npm install -g gulp && \
    npm install code-forensics

WORKDIR /root

CMD ["/bin/bash"]

docker-compose.yml:

version: "3.0"

services:
  code-analysis:
    build: .
    image: codeforensics
    stdin_open: true
    tty: true
    command: /bin/bash
    volumes:
      - $PWD:/root
      - $PWD/gulpfile.js:/root/gulpfile.js

Then executed: docker-compose build

and then:

$ docker-compose run code-analysis
bash-4.3# gulp list-analysis-tasks
Platform dependency error
Cannot find the git commmand.
bash-4.3#

When I include git in the Dockerfile installation statements, gulps works fine :-)

gernotstarke commented 6 years ago

actually my idea was to have code-forensics running as a Docker container, as I didn't want to have all these JS dependencies installed on my dev machine...

gernotstarke commented 6 years ago

aah - btw: If you try out this docker stuff, don't forget to execute docker-compose down after exiting your container - as in some cases Docker cannot handle errors gracefully...

smontanari commented 6 years ago

Release 0.15.2 (6c4e4dbe649df566112db040200e3a0faa2ef0a4) has fixed the issue. Of course either git or svn will be required to run any analysis task, but neither is an actual pre-requisite