Skip to content

Commit e89f94a

Browse files
committed
cleaned up the old legacy names
Build scripts and the SonarQube workflow is affected.
1 parent e24564c commit e89f94a

5 files changed

+43
-42
lines changed

.github/build-docker-image.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
display_help() {
44
echo "Usage: $0 -i image_name -v version -r registry -a architecture " >&2
55
echo
6-
echo " -i image_name Specify the image name, for example: devs_xg24_aoa_poc"
6+
echo " -i image_name Specify the image name, for example: bluetooth-aoa-example-build-env"
77
echo " -v version Specify the version of docker image, for example: 1.0.0"
8-
echo " -r registry Specify the Docker registry to push the image to (optional) example: lx0017637.silabs.com:5000"
8+
echo " -r registry Specify the Docker registry to push the image to (optional)"
99
echo " If internal registry is used, SonarQube will be included."
1010
echo " -a architecture Specify the architecture, for example: x86_64 or aarch64"
1111
echo

.github/build-with-docker.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
display_help() {
44
echo "Usage: $0 -i image_name -v version -r registry -a architecture -c clean" >&2
55
echo
6-
echo " -i image_name Specify the image name, for example: devs_xg24_aoa_poc"
6+
echo " -i image_name Specify the image name, for example: bluetooth-aoa-example-build-env"
77
echo " -v version Specify the version of docker image, for example: 1.0.0"
88
echo " -r registry Specify the Docker registry to push the image to"
99
echo " -a architecture Specify the architecture, for example: x86_64 or aarch64 (optional)"
@@ -12,7 +12,7 @@ display_help() {
1212
exit 1
1313
}
1414

15-
image_name="devs_xg24_aoa_poc"
15+
image_name="bluetooth-aoa-example-build-env"
1616
version="1.0.0"
1717
registry="none"
1818
architecture="x86_64"
@@ -53,7 +53,7 @@ sh ./.github/build-docker-image.sh -i $image_name -v $version -r $registry -a $a
5353

5454
echo "<----- Running the docker based build environment ----->"
5555
# Run the docker image
56-
docker run -u root --rm -v $(pwd):/home/jenkins/devs_xg24_aoa_poc $image_name:$version /bin/sh -c "cd devs_xg24_aoa_poc && make all"
56+
docker run -u root --rm -v $(pwd):/home/jenkins/$image_name $image_name:$version /bin/sh -c "cd $image_name && make all"
5757

5858
if [ "$clean" = "true" ]; then
5959
docker rmi $image_name:$version
+34-34
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,43 @@
11
name: 03-SonarQube-Analysis
22

33
on:
4-
#It is an internal tool, it can only ran a self hosted runner. Currently it can be triggered only manually.
4+
# It is an internal tool, it can only run on a self-hosted runner. Currently, it can be triggered only manually.
55
workflow_dispatch:
66

7-
87
jobs:
9-
sonarqube:
10-
runs-on: llbp-bud-lab006
11-
env:
12-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
13-
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
14-
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v4.2.2
17-
18-
- name: Pull a docker image file
19-
run: docker pull lx0017637.silabs.com:5000/devs_identec_xg24_aoa_poc:1.0.0
8+
sonarqube:
9+
runs-on: llbp-bud-lab006
10+
env:
11+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
12+
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
13+
INTERNAL_REPOSITORY_NAME: "lx0017637.silabs.com:5000"
14+
DOCKER_IMAGE: "bluetooth-aoa-example-build-env:1.0.0"
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4.2.2
2018

21-
- name: Run SonarQube analysis
19+
- name: Pull a docker image file
20+
run: docker pull ${{ env.INTERNAL_REPOSITORY_NAME }}/${{ env.DOCKER_IMAGE }}
2221

23-
run: |
24-
docker run -u root --rm -v $(pwd):/home/jenkins/devs_identec_xg24_aoa_poc lx0017637.silabs.com:5000/devs_identec_xg24_aoa_poc:1.0.0 /bin/sh -c "
25-
cd devs_identec_xg24_aoa_poc &&
26-
make all &&
27-
rm -rf sonar-bw &&
28-
rm -rf .scannerwork &&
29-
rm -rf locator_ncp/build &&
30-
rm -rf locator_host/build
31-
mkdir sonar-bw &&
32-
/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonar-bw/locator_host/ make locator_host &&
33-
/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonar-bw/locator_ncp/ make locator_ncp &&
34-
sonar-scanner -Dsonar.token=$SONAR_TOKEN -Dsonar.host.url=$SONAR_HOST_URL"
22+
- name: Run SonarQube analysis
23+
run: |
24+
docker run -u root --rm -v $(pwd):/home/jenkins/bluetooth-aoa-example ${{ env.INTERNAL_REPOSITORY_NAME }}/${{ env.DOCKER_IMAGE }} /bin/sh -c " \
25+
cd bluetooth-aoa-example && \
26+
make all && \
27+
rm -rf sonar-bw && \
28+
rm -rf .scannerwork && \
29+
rm -rf locator_ncp/build && \
30+
rm -rf locator_host/build && \
31+
mkdir sonar-bw && \
32+
/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonar-bw/locator_host/ make locator_host && \
33+
/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sonar-bw/locator_ncp/ make locator_ncp && \
34+
sonar-scanner -Dsonar.token=$SONAR_TOKEN -Dsonar.host.url=$SONAR_HOST_URL"
3535
36-
- name: Cleanup leftover files
37-
if: always()
38-
run: |
39-
docker run -u root --rm -v $(pwd):/home/jenkins/devs_identec_xg24_aoa_poc lx0017637.silabs.com:5000/devs_identec_xg24_aoa_poc:1.0.0 /bin/sh -c "
40-
rm -rf sonar-bw && \
41-
rm -rf .scannerwork && \
42-
rm -rf locator_ncp/build && \
43-
rm -rf locator_host/build "
36+
- name: Cleanup leftover files
37+
if: always()
38+
run: |
39+
docker run -u root --rm -v $(pwd):/home/jenkins/bluetooth-aoa-example ${{ env.INTERNAL_REPOSITORY_NAME }}/${{ env.DOCKER_IMAGE }} /bin/sh -c "
40+
rm -rf sonar-bw && \
41+
rm -rf .scannerwork && \
42+
rm -rf locator_ncp/build && \
43+
rm -rf locator_host/build "

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Angle of Arrival locator project
2+
- [Angle of Arrival locator project](#angle-of-arrival-locator-project)
23
- [Overview](#overview)
34
- [NCP firmware](#ncp-firmware)
45
- [Host firmware](#host-firmware)
@@ -112,15 +113,15 @@ The *build-with-docker.sh* script handles all the building process.
112113
You should start the script directly from the repo main folder. Otherwise the paths can be messed up.
113114

114115
You can use the following command line options:
115-
- "-i" image_name Specify the image name. Default value: *devs_xg24_aoa_poc-build-env*
116+
- "-i" image_name Specify the image name. Default value: *bluetooth-aoa-example-build-env*
116117
- "-v" version Specify the version of docker image. Default value: *1.0.0*
117118
- "-r" registry Specify the Docker registry to push the image to. Default value: *none*
118119
- "-a" architecture Specify architecture of build machine. Accepted values are `x86_64` and `aarch64`. Defaults to `x86_64`
119120
- "-c" clean Boolean option. if it is added then after the build process the docker image is removed to save storage space. Default value: *true*
120121

121122
Example:
122123
```bash
123-
~/devs_xg24_aoa_poc$ sh .github/build-with-docker.sh -i devs_xg24_aoa_poc-build-env -v 1.0.0 -c
124+
~/devs_xg24_aoa_poc$ sh .github/build-with-docker.sh -i bluetooth-aoa-example-build-env -v 1.0.0 -c
124125
```
125126

126127
## How to use the project

sonar-project.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
sonar.host.url= http://sonarqube.silabs.net/
33
# must be unique in a given SonarQube instance
4-
sonar.projectKey=devs_identec_xg24_aoa_poc
4+
sonar.projectKey=bluetooth-AoA-example
55
sonar.cfamily.variants.names=locator_host,locator_ncp
66
sonar.cfamily.variants.dir = sonar-bw
77

0 commit comments

Comments
 (0)