Skip to content

Commit

Permalink
update sonoar scanner version
Browse files Browse the repository at this point in the history
  • Loading branch information
sokhealy committed Jul 22, 2024
1 parent 21da040 commit 84348ea
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
types: [opened, synchronize, reopened]
env:
SONAR_SCANNER_VERSION: 4.7.0.2747
SONAR_SCANNER_VERSION: 6.1.0.4477
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
PARALLEL_THREADS: 2
Expand Down
24 changes: 15 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM osrf/ros:humble-desktop

ARG SONAR_SCANNER_VERSION=4.7.0.2747
ARG SONAR_SCANNER_VERSION=6.1.0.4477

ARG DEBIAN_FRONTEND=noninteractive

Expand All @@ -11,23 +11,29 @@ ENV HOME /home/dockerdev
ARG UID=1000

RUN apt-get update && apt-get install --yes \
apt-utils \
build-essential \
pkg-config \
cmake \
doxygen \
check \
clang-format-13 \
libserialport-dev \
ros-humble-gps-msgs \
# Sonar-scanner dependency
openjdk-19-jdk
ros-humble-gps-msgs

# Add a "dockerdev" user with sudo capabilities
# 1000 is the first user ID issued on Ubuntu; might
# be different for Mac users. Might need to add more.
RUN useradd -u ${UID} -ms /bin/bash -G sudo dockerdev && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers && \
chown -R dockerdev:dockerdev $HOME/
# Create the user with the specified UID
RUN useradd -u $UID -m dockerdev && \
# Set the user's shell to /bin/bash
chsh -s /bin/bash dockerdev && \
# Add the user to the sudo group
usermod -aG sudo dockerdev && \
# Add the user to sudoers with no password prompt for sudo commands
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
# Change ownership of the home directory to the new user
chown -R dockerdev:dockerdev $HOME

USER dockerdev

Expand All @@ -46,10 +52,10 @@ RUN sudo apt-get -y install gcovr
# Download and set up sonar-scanner
RUN sudo apt-get -y install unzip && \
mkdir -p $HOME/.sonar && \
curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux.zip && \
curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${SONAR_SCANNER_VERSION}-linux-x64.zip && \
unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/

ENV PATH="${PATH}:/home/dockerdev/.sonar/sonar-scanner-${SONAR_SCANNER_VERSION}-linux/bin"
ENV PATH="${PATH}:/home/dockerdev/.sonar/sonar-scanner-${SONAR_SCANNER_VERSION}-linux-x64/bin"

WORKDIR /mnt/workspace/src/swiftnav-ros2

Expand Down
2 changes: 0 additions & 2 deletions code_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

export GITHUB_TOKEN=$1
export SONAR_TOKEN=$2
export JAVA_HOME=/usr/lib/jvm/java-19-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH

mkdir -p build
cd build
Expand Down

0 comments on commit 84348ea

Please sign in to comment.