Skip to content

Commit 860e1d0

Browse files
committed
fixing gh-pages
1 parent 70072d4 commit 860e1d0

3 files changed

Lines changed: 36 additions & 19 deletions

File tree

c_cpp/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ FROM ubuntu:18.04
55

66
VOLUME /repo
77

8-
WORKDIR /repo
8+
WORKDIR /tmp
99

1010

1111
ENV SONAR_SCANNER_VERSION 4.2.0.1873
@@ -19,5 +19,10 @@ ENV PATH="${SONAR_SCANNER_HOME}/build-wrapper-linux-x86:${PATH}"
1919
ENV PATH="${SONAR_SCANNER_HOME}/sonar-scanner-${SONAR_SCANNER_VERSION}-linux/bin:${PATH}"
2020

2121
COPY provision.sh /
22+
COPY sonar_qube.sh /
2223

2324
RUN /provision.sh
25+
RUN /sonar_qube.sh
26+
RUN pip3 install virtualenv
27+
RUN pip3 install tox
28+
RUN npm install -g gh-pages

c_cpp/provision.sh

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,6 @@ apt-get -y install graphviz
5252
apt-get -y install curl
5353
apt-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-
7355
echo "export PATH=$PATH" >> ~/.bashrc
7456
echo "export LANG=en_US.UTF-8" >> ~/.bashrc
7557
echo "export LANGUAGE=en_US:en" >> ~/.bashrc

c_cpp/sonar_qube.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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

0 commit comments

Comments
 (0)