From 1cf0f595b09563126cf7731d01aeaa694dfbb074 Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Fri, 8 Feb 2019 10:02:28 -0500 Subject: [PATCH 01/21] Add sonarcloud and circle ci support to repo --- .circleci/config.yml | 91 +++++++++++++++++++++++++++++ .sonarqube/sonar-scanner.properties | 30 ++++++++++ 2 files changed, 121 insertions(+) create mode 100644 .circleci/config.yml create mode 100644 .sonarqube/sonar-scanner.properties diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..f5d90f27 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,91 @@ +version: 2 + +# Copyright (C) 2018-2019 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. +# + +# Configuration file for Circle CI +# CI will report failure if any executed command returns and error status +# Operations performed are as follows +# Build source code +# Run unit tests for C++ and Java +# Run static code analyzer for SourceCloud +# Upload test results +# Every run command should start with source ${INIT_ENV} to ensure all default dependancies are available +jobs: + build: + # Pull docker image from docker hub + # XTERM used for better catkin_make output + docker: + - image: usdotfhwastol/carma-base-ci:2.8.3 + user: carma + environment: + TERM: xterm + INIT_ENV: /home/carma/.base-image/init-env.sh + # Set working directory + working_directory: "/opt/carma/" + # Pull code and execute tests + # Name of each run command defines purpose use + steps: + - run: + name: Create src folder + command: | + source ${INIT_ENV} + mkdir src + cd src + mkdir CARMAAvtVimbaDriver + mkdir CARMAMsgs + # Checkout PR branch + - checkout: + path: src/CARMAAvtVimbaDriver + - run: + name: Pull CARMAMsgs + command: | + source ${INIT_ENV} + git clone -b develop --depth 1 git@github.com:usdot-fhwa-stol/CARMAMsgs.git src/CARMAMsgs + - run: + name: Build Driver + command: | + source ${INIT_ENV} + build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make install + - run: + name: Run C++ Tests + command: | + source ${INIT_ENV} + catkin_make run_tests + # Run SonarCloud analysis + # PR Branchs and number extracted from Circle variables and github api + # Circle CI seems to make a change to the base branch, so we must fetch --force to ensure correct git file change stats + # SONAR_SCANNER_TOKEN MUST be secured as an environment variable in Circle CI NOT in this file. + # The following sonar settings MUST be set in SonarCloud UI NOT in this file + # sonar.pullrequest.provider + # sonar.pullrequest.github.endpoint + # sonar.pullrequest.github.token.secured + # sonar.pullrequest.github.repository + # Use -X on sonar-scanner to enable debug output + - run: + name: Run Sonar Scanner + command: | + source ${INIT_ENV} + echo "PR branch ${CIRCLE_BRANCH}" + echo "Repo name ${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" + echo "URL ${CIRCLE_PULL_REQUEST}" + export PR_NUM=`echo ${CIRCLE_PULL_REQUEST} | cut -d'/' -f7` + echo "PR number ${PR_NUM}" + export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}" + export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"') + echo "Target Branch = ${TARGET_BRANCH}" + cd src/CARMAPlatform + git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} + sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} diff --git a/.sonarqube/sonar-scanner.properties b/.sonarqube/sonar-scanner.properties new file mode 100644 index 00000000..6d1e6be9 --- /dev/null +++ b/.sonarqube/sonar-scanner.properties @@ -0,0 +1,30 @@ +# Copyright (C) 2018-2019 LEIDOS. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# Configuration file for Sonar Scanner used for CI + +sonar.projectKey=usdot-fhwa-stol_CARMAAvtVimbaDriver +sonar.organization=usdot-fhwa-stol +sonar.cfamily.build-wrapper-output=/opt/carma/bw-output +sonar.host.url=https://sonarcloud.io +sonar.java.binaries=/opt/carma/install +sonar.java.test.binaries=build/ +sonar.java.libraries=/opt/carma/install +sonar.java.test.libraries=/opt/carma/install +sonar.sources=src/main +sonar.tests=src/test +# Disable SCM sensor as it is unused but generates warning +sonar.scm.disabled=false +sonar.scm.enabled=true +sonar.scm.provider=git From b75b6dc825e358ec0af7dfae4e999f122808e5e6 Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Fri, 8 Feb 2019 14:25:22 -0500 Subject: [PATCH 02/21] Updated image --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f5d90f27..4cec81be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,7 +28,7 @@ jobs: # Pull docker image from docker hub # XTERM used for better catkin_make output docker: - - image: usdotfhwastol/carma-base-ci:2.8.3 + - image: usdotfhwastol/carma-base-ci:2.8.4 user: carma environment: TERM: xterm From 5076f3522f29ec45e243b00ce81959e47183389c Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Fri, 8 Feb 2019 17:15:45 -0500 Subject: [PATCH 03/21] debug --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 4cec81be..5cb13696 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: name: Build Driver command: | source ${INIT_ENV} - build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make install + build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make install -DCMAKE_BUILD_TYPE=Debug - run: name: Run C++ Tests command: | From 03dc0509e4916e073dbffd49b4a0c03d040829ce Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Fri, 8 Feb 2019 17:18:51 -0500 Subject: [PATCH 04/21] change arge order --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5cb13696..de16311e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: name: Build Driver command: | source ${INIT_ENV} - build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make install -DCMAKE_BUILD_TYPE=Debug + build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make -DCMAKE_BUILD_TYPE=Debug install - run: name: Run C++ Tests command: | From 8661b4ce86873f69b0d722ea3dcb620cf140c55b Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Fri, 8 Feb 2019 17:24:59 -0500 Subject: [PATCH 05/21] Try memory limit --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index de16311e..9fbb1713 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: name: Build Driver command: | source ${INIT_ENV} - build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make -DCMAKE_BUILD_TYPE=Debug install + build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make --mem-limit 70% install - run: name: Run C++ Tests command: | From 6653a26360563a8938ed224b1ea0074b5ec4f4b7 Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Fri, 8 Feb 2019 17:28:06 -0500 Subject: [PATCH 06/21] Force cmake --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9fbb1713..638c679d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: name: Build Driver command: | source ${INIT_ENV} - build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make --mem-limit 70% install + build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make --force-cmake --mem-limit 70% install - run: name: Run C++ Tests command: | From f570746620e1cca8cf286165352735b4d6011ab3 Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Fri, 8 Feb 2019 17:36:11 -0500 Subject: [PATCH 07/21] undo changes --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 638c679d..d776b386 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: name: Build Driver command: | source ${INIT_ENV} - build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make --force-cmake --mem-limit 70% install + build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make install - run: name: Run C++ Tests command: | From 85b59411fdbb1b099971d3e77355d68129a33139 Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 09:14:21 -0500 Subject: [PATCH 08/21] Try -j arg --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d776b386..fa5c1c56 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: name: Build Driver command: | source ${INIT_ENV} - build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make install + build-wrapper-linux-x86-64 --out-dir /opt/carma/bw-output catkin_make install -j 2 - run: name: Run C++ Tests command: | From d9ccd6a02a31663e408bc9d8db85800547dee990 Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 09:18:29 -0500 Subject: [PATCH 09/21] Fix branch name --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fa5c1c56..6d7844d2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,6 +86,6 @@ jobs: export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}" export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"') echo "Target Branch = ${TARGET_BRANCH}" - cd src/CARMAPlatform + cd src/CARMAAvtVimbaDriver git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} From c43a0fd49ddb4aefe2440051df1079b8dd5cb55e Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 09:25:01 -0500 Subject: [PATCH 10/21] Fix bug in properties file --- .sonarqube/sonar-scanner.properties | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.sonarqube/sonar-scanner.properties b/.sonarqube/sonar-scanner.properties index 6d1e6be9..74a272d3 100644 --- a/.sonarqube/sonar-scanner.properties +++ b/.sonarqube/sonar-scanner.properties @@ -18,12 +18,9 @@ sonar.projectKey=usdot-fhwa-stol_CARMAAvtVimbaDriver sonar.organization=usdot-fhwa-stol sonar.cfamily.build-wrapper-output=/opt/carma/bw-output sonar.host.url=https://sonarcloud.io -sonar.java.binaries=/opt/carma/install -sonar.java.test.binaries=build/ -sonar.java.libraries=/opt/carma/install -sonar.java.test.libraries=/opt/carma/install -sonar.sources=src/main -sonar.tests=src/test +sonar.sources=src/ +# TODO Uncomment following line when tests are added +#sonar.tests=test/ # Disable SCM sensor as it is unused but generates warning sonar.scm.disabled=false sonar.scm.enabled=true From b71ea04d39399c3c5006d235f6a18dfc86854d0f Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 10:08:21 -0500 Subject: [PATCH 11/21] debug print --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d7844d2..6a8930c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,6 +86,8 @@ jobs: export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}" export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"') echo "Target Branch = ${TARGET_BRANCH}" + echo "Branches" + git branch -l cd src/CARMAAvtVimbaDriver git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} From 4eb4f23e209f2f7c754e6ee85a7c0db5db2eff39 Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 10:14:33 -0500 Subject: [PATCH 12/21] Change print location --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6a8930c2..f0223709 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,8 +86,8 @@ jobs: export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}" export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"') echo "Target Branch = ${TARGET_BRANCH}" + cd src/CARMAAvtVimbaDriver echo "Branches" git branch -l - cd src/CARMAAvtVimbaDriver git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} From b5fed0251e487d617437baa5eb92df135468bb20 Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 10:39:10 -0500 Subject: [PATCH 13/21] List remote branches --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f0223709..55edff6d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -88,6 +88,6 @@ jobs: echo "Target Branch = ${TARGET_BRANCH}" cd src/CARMAAvtVimbaDriver echo "Branches" - git branch -l + git branch -la git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} From 5ea24b4b781795bf7f8b751a656fa9c4673c6d9b Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 10:52:01 -0500 Subject: [PATCH 14/21] More prints --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55edff6d..b2bd27c7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -88,6 +88,7 @@ jobs: echo "Target Branch = ${TARGET_BRANCH}" cd src/CARMAAvtVimbaDriver echo "Branches" - git branch -la + git branch -avv + git remote -vv git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} From 1019a8c412856d6663dbac90d9eb31345043f9ab Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 10:56:46 -0500 Subject: [PATCH 15/21] Debug print --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index b2bd27c7..12b22df5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -85,6 +85,7 @@ jobs: echo "PR number ${PR_NUM}" export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}" export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"') + echo $BASE_BRANCH_URL echo "Target Branch = ${TARGET_BRANCH}" cd src/CARMAAvtVimbaDriver echo "Branches" From 164f0f5aa6a92cf167a4dafdcb1d6260c734accb Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 11:03:56 -0500 Subject: [PATCH 16/21] Remove arg --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 12b22df5..e18dd0a5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,4 +92,4 @@ jobs: git branch -avv git remote -vv git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} - sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} + sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} From 1dd4ea09f41eef883975646d4335692bd3ef1e0f Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 11:15:44 -0500 Subject: [PATCH 17/21] Hard code base --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e18dd0a5..33a24a89 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,4 +92,4 @@ jobs: git branch -avv git remote -vv git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} - sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} + sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=kinetic -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} From 18cac1b1d77d1e48a9261781ab230777ffad1a3a Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 11:21:52 -0500 Subject: [PATCH 18/21] Try again --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 33a24a89..59f5384a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,4 +92,4 @@ jobs: git branch -avv git remote -vv git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} - sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=kinetic -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} + sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=origin/kinetic -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} From 1cde6d16ca109989cdb4363f4ce869b2f79074cd Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Mon, 11 Feb 2019 12:54:26 -0500 Subject: [PATCH 19/21] Trying another change --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 59f5384a..33a24a89 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,4 +92,4 @@ jobs: git branch -avv git remote -vv git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} - sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=origin/kinetic -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} + sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=kinetic -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} From 6972cd27c348fcd320fd522a4aef8538f27d8530 Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Tue, 12 Feb 2019 09:34:18 -0500 Subject: [PATCH 20/21] try colon --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 33a24a89..f389ad91 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -92,4 +92,4 @@ jobs: git branch -avv git remote -vv git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} - sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=kinetic -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} + sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=usdot-fhwa-stol:kinetic -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} From 64919c73b49e030869ddcb9049944a8e6e9125d5 Mon Sep 17 00:00:00 2001 From: Michael McConnell Date: Tue, 12 Feb 2019 09:42:36 -0500 Subject: [PATCH 21/21] Undo changes to config --- .circleci/config.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f389ad91..6d7844d2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -85,11 +85,7 @@ jobs: echo "PR number ${PR_NUM}" export BASE_BRANCH_URL="https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/pulls/${PR_NUM}" export TARGET_BRANCH=$(curl "$BASE_BRANCH_URL" | jq '.base.ref' | tr -d '"') - echo $BASE_BRANCH_URL echo "Target Branch = ${TARGET_BRANCH}" cd src/CARMAAvtVimbaDriver - echo "Branches" - git branch -avv - git remote -vv git fetch --force origin ${TARGET_BRANCH}:${TARGET_BRANCH} - sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=usdot-fhwa-stol:kinetic -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM} + sonar-scanner -Dproject.settings=.sonarqube/sonar-scanner.properties -Dsonar.login=${SONAR_SCANNER_TOKEN} -Dsonar.pullrequest.base=${TARGET_BRANCH} -Dsonar.pullrequest.branch=${CIRCLE_BRANCH} -Dsonar.pullrequest.key=${PR_NUM}