]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
ci: add sonarcloud build 74391 74404
authorTomas Krizek <tomas.krizek@nic.cz>
Tue, 5 Jan 2021 15:43:37 +0000 (16:43 +0100)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Thu, 7 Jan 2021 09:00:53 +0000 (10:00 +0100)
.gitlab-ci.yml
ci/debian-buster/Dockerfile

index 6543b7978d9036a44777f4b1fa892eaca78f358e..0198ce99f90507fc6b2e0eb210cc4f08449be6a8 100644 (file)
@@ -122,6 +122,18 @@ docker:
   after_script:  # remove dangling images to avoid running out of disk space
     - docker rmi ${DOCKER_IMAGE_NAME}
     - docker rmi $(docker images -f "dangling=true" -q)
+
+sonarcloud:
+  <<: *nodep
+  stage: build
+  except: null
+  only:
+    - tags
+    - master@knot/knot-resolver
+  script:
+    - meson build_sonarcloud --default-library=static --prefix=$PREFIX
+    - build-wrapper-linux-x86-64 --out-dir bw-output ninja -C build_sonarcloud
+    - sonar-scanner -Dsonar.organization=cz-nic -Dsonar.projectKey=CZ-NIC_knot-resolver -Dsonar.sources=.  -Dsonar.cfamily.build-wrapper-output=bw-output -Dsonar.host.url=https://sonarcloud.io
 # }}}
 
 # sanity {{{
index 3d112ff57a617e918521e1831078cf196722655e..82bdbdcaec1b0798f5b3c10fde563c3853272a52 100644 (file)
@@ -118,3 +118,10 @@ RUN apt-get install -y -qqq lua-http lua-psl
 RUN apt-get install -y -qqq locales
 RUN sed -i "/en_US.UTF-8/ s/^#\(.*\)/\1/" /etc/locale.gen
 RUN locale-gen
+
+# SonarCloud scanner
+RUN wget -O /var/opt/wrapper.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
+RUN wget -O /var/opt/scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.4.0.2170-linux.zip
+RUN unzip -d /var/opt /var/opt/wrapper.zip
+RUN unzip -d /var/opt /var/opt/scanner.zip
+ENV PATH "$PATH:/var/opt/build-wrapper-linux-x86:/var/opt/sonar-scanner-4.4.0.2170-linux/bin"