We have got a node.js/typescript project and now I am supposed to provide data to our sonarqube analysis.
We are using a docker container to run our tests in and after the tests are finished, we are running the sonarqube analysis so we can use the code coverage report from the tests for it.
The only problem is, that the blame information is missing. This is why i tried to copy the .git folder into the docker container, but so far I did not succeed. This is the content of my Dockerfile.
FROM node:11.6-alpine
RUN apk --update add openjdk8-jre
WORKDIR /dist
COPY package*.json ./
RUN npm install
COPY src/ ./src/
COPY test/ ./test/
COPY ts*.json ./
COPY sonar-project.properties ./
COPY test.sh /
COPY .git/ ./
RUN chmod +x /test.sh
CMD ["sh", "/test.sh"]
I have read, that the .dockerignore file can be used to exclude files or folder but we are not using such a file and I also tried creating one that only contains node_modules, but that also did not work.
Has anybody got any idea how to include it or any tipp what to google? I only find "how to exclude .git from the docker container" but reverting those tipps did not help so far.
Edit: To make it even stranger using COPY . ./
includes the .git folder into the image.