From 12decc9273eef2901a023d2f15cfdbcb4d8d434f Mon Sep 17 00:00:00 2001 From: sokhealy Date: Mon, 22 Jul 2024 13:35:29 -0700 Subject: [PATCH] Update Sonar Scanner to 6.1.0.447 (#45) Update Sonar Scanner to 6.1.0.447 due to CI failure. --- .github/workflows/build.yml | 2 +- Dockerfile | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c07a921..0374be0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 97f61c5..5df4922 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -11,6 +11,7 @@ ENV HOME /home/dockerdev ARG UID=1000 RUN apt-get update && apt-get install --yes \ + apt-utils \ build-essential \ pkg-config \ cmake \ @@ -23,9 +24,16 @@ RUN apt-get update && apt-get install --yes \ # 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 @@ -44,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