ejwa / gitinspector

:bar_chart: The statistical analysis tool for git repositories
GNU General Public License v3.0
2.38k stars 328 forks source link

Dockerfile and Dockerhub deployment for easy Windows execution #229

Open chr15t0ph opened 2 years ago

chr15t0ph commented 2 years ago

Hi! Thank you for your great tool!

Could you please add a Dockerfile to your repository? And deploy latest versions to docker, e.g., as ejwa/gitinspector:latest. The last version on Dockerhub is from Felix Hummel in version 0.4.4 and I would like to get the current version!

This Dockerfile could be used as template for you:

FROM python:2-alpine3.7

ENV PYTHONIOENCODING=utf-8

RUN apk add --no-cache git \
 && apk add --no-cache tree

ADD gitinspector/ /tmp/gitinspector/gitinspector/
ADD DESCRIPTION.txt /tmp/gitinspector/
ADD setup.py /tmp/gitinspector/

WORKDIR /tmp/gitinspector
RUN python setup.py install

WORKDIR /
RUN rm -r /tmp/gitinspector

WORKDIR /repo

ENTRYPOINT ["gitinspector"]

Use Case

I am a lecturer in a Windows environment, applying gitinspector to support grading. I will use docker to easily run gitinspector under windows (currently with felix/gitinspector:0.4.4). I give you an example execution (with the Dockerfile from above, respecting the set workdir and entrypoint):

In the example, I assume that you would deploy to Dockerhub as ejwa/gitinspector:latest and use that one (instead of the felix/gitinspector:0.4.4 one):

docker run --rm -v C:\scm\2021WS-TeamGruen:/repo ejwa/gitinspector:latest --format=html --grading -L --file-types=java,cs,c,cc,cpp,h,hh,hpp,glsl,php,py,pl,scala,rb,js,ts,vue,ml,mli,hs,po,pot,sql,html,htm,css,scss,sass,xml,jsp,jspx,ipynb,doc,docx,xls,xlsx,txt,md,tex,bib,*,marker,yml,cmd,bat,sh,sln,csproj,conf,iml,yaml,template,jsx -x file:package-lock.json -x "file:.cls$" -x file:assets -x file:node_modules --since="10.10.2021" > "C:\scm\2021WS-TeamGruen_gitinspector.html"
adam-waldenberg commented 2 years ago

Thanks. When I have time I might look into this.

DmytroSokhach commented 1 year ago

In my case I've got warning:

warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your diff.renameLimit variable to at least 656 and retry the command.

and had to add:

RUN git config --global merge.renamelimit 0
RUN git config --global diff.renamelimit 0

Built with:

docker build -f ./gitinspector.Dockerfile -t gitinspector:local .

Command used for TypeScript/React project:

$ repo_full_path=~/pj/myrepo
$ docker run --rm -v $repo_full_path:/repo gitinspector:local --format=html --grading --since="01.03.2020" --file-types=ts,tsx > foo.html