Skip to content

Commit

Permalink
Download latest sonar-scanner and build-wrapper (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
velomatt authored Nov 29, 2023
1 parent b654c03 commit 85507df
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
17 changes: 15 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,15 @@ stages:

build dss-sdk:
stage: build
script: build-wrapper-linux-x86-64 --out-dir bw-output/ ./scripts/build_all.sh kdd-samsung-remote
script:
# Download build wrapper from local SonarQube
- rm -rf /build-wrapper-linux-x86
- wget --no-verbose --content-disposition -E -c "$SONAR_HOST_URL/static/cpp/build-wrapper-linux-x86.zip"
- unzip -q build-wrapper-linux-x86.zip -d /
# Disable ssl verify from docker build env
- git config --global http.sslVerify false
# Build client with build-wrapper
- /build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output/ ./scripts/build_all.sh kdd-samsung-remote
variables:
GIT_SUBMODULE_STRATEGY: recursive
artifacts:
Expand Down Expand Up @@ -68,7 +76,12 @@ target unit test coverage report:
sonar-scanner:
stage: scan
script:
- sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.cfamily.build-wrapper-output=bw-output -Dsonar.coverageReportPaths=$SONAR_UNIT_TEST_REPORT
# Download latest sonar-scanner from sonar-source
- rm -rf /sonar-scanner*
- wget --no-verbose --content-disposition -E -c "https://search.maven.org/remote_content?g=org.sonarsource.scanner.cli&a=sonar-scanner-cli&v=LATEST&c=linux&e=zip"
- unzip -q sonar-scanner-cli-*.zip -d /
# Scan with sonar-scanner
- /sonar-scanner-*-linux/bin/sonar-scanner -Dsonar.qualitygate.wait=true -Dsonar.cfamily.build-wrapper-output=bw-output -Dsonar.coverageReportPaths=$SONAR_UNIT_TEST_REPORT
allow_failure: true
dependencies:
- build dss-sdk
Expand Down
8 changes: 7 additions & 1 deletion buildspec/dss-sdk-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ env:
DSSGLOBLIST: "nkv-sdk-*.tgz nkv-target-*.tgz"

phases:
pre_build:
commands:
# Download latest build-wrapper
- rm -rf /build-wrapper-linux-x86
- wget --no-verbose --content-disposition -E -c "https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip"
- unzip -q build-wrapper-linux-x86.zip -d /
build:
commands:
# Build dss-sdk with Sonar build-wrapper for C/C++ static analysis
- build-wrapper-linux-x86-64 --out-dir bw-output ./scripts/build_all.sh kdd-samsung-remote
- /build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output ./scripts/build_all.sh kdd-samsung-remote
post_build:
commands:
# Copy artifacts to branch dir if this is a merge
Expand Down

0 comments on commit 85507df

Please sign in to comment.