File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ FROM ubuntu:18.04
55
66VOLUME /repo
77
8- WORKDIR /repo
8+ WORKDIR /tmp
99
1010
1111ENV SONAR_SCANNER_VERSION 4.2.0.1873
@@ -19,5 +19,10 @@ ENV PATH="${SONAR_SCANNER_HOME}/build-wrapper-linux-x86:${PATH}"
1919ENV PATH="${SONAR_SCANNER_HOME}/sonar-scanner-${SONAR_SCANNER_VERSION}-linux/bin:${PATH}"
2020
2121COPY provision.sh /
22+ COPY sonar_qube.sh /
2223
2324RUN /provision.sh
25+ RUN /sonar_qube.sh
26+ RUN pip3 install virtualenv
27+ RUN pip3 install tox
28+ RUN npm install -g gh-pages
Original file line number Diff line number Diff line change @@ -52,24 +52,6 @@ apt-get -y install graphviz
5252apt-get -y install curl
5353apt-get -y install unzip
5454
55- pip3 install virtualenv
56- pip3 install tox
57-
58- # a well-known workaround for npm install on docker
59- # what. a. fail.
60- mv /usr/local/lib/node_modules /usr/local/lib/node_modules.tmp && \
61- mv /usr/local/lib/node_modules.tmp /usr/local/lib/node_modules && \
62- npm install -g gh-pages
63-
64- # Sonarqube
65- curl --create-dirs -sSLo $HOME /.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION -linux.zip
66- unzip -o $HOME /.sonar/sonar-scanner.zip -d $SONAR_SCANNER_HOME
67-
68- curl --create-dirs -sSLo $HOME /.sonar/build-wrapper-linux-x86.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
69- unzip -o $HOME /.sonar/build-wrapper-linux-x86.zip -d $SONAR_SCANNER_HOME
70-
71- rm -rf $HOME /.sonar
72-
7355echo " export PATH=$PATH " >> ~ /.bashrc
7456echo " export LANG=en_US.UTF-8" >> ~ /.bashrc
7557echo " export LANGUAGE=en_US:en" >> ~ /.bashrc
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # +----------------------------------------------------------+
4+ # | BASH : Modifying Shell Behaviour
5+ # | (https://www.gnu.org/software/bash/manual)
6+ # +----------------------------------------------------------+
7+ # Treat unset variables and parameters other than the special
8+ # parameters ‘@’ or ‘*’ as an error when performing parameter
9+ # expansion. An error message will be written to the standard
10+ # error, and a non-interactive shell will exit.
11+ set -o nounset
12+
13+ # Exit immediately if a pipeline returns a non-zero status.
14+ set -o errexit
15+
16+ # If set, the return value of a pipeline is the value of the
17+ # last (rightmost) command to exit with a non-zero status, or
18+ # zero if all commands in the pipeline exit successfully.
19+ set -o pipefail
20+
21+ # +----------------------------------------------------------+
22+
23+ # Sonarqube
24+ curl --create-dirs -sSLo $HOME /.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION -linux.zip
25+ unzip -o $HOME /.sonar/sonar-scanner.zip -d $SONAR_SCANNER_HOME
26+
27+ curl --create-dirs -sSLo $HOME /.sonar/build-wrapper-linux-x86.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
28+ unzip -o $HOME /.sonar/build-wrapper-linux-x86.zip -d $SONAR_SCANNER_HOME
29+
30+ rm -rf $HOME /.sonar
You can’t perform that action at this time.
0 commit comments