Skip to content

Commit 5d1d4f5

Browse files
committed
Updated Travis config for Sonar scans
1 parent cee6cfc commit 5d1d4f5

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

‎.build/build.sh‎

100644100755
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,25 @@
22
set -e
33

44
export NVM_DIR="$HOME/.nvm"
5-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
5+
[[ -s "$NVM_DIR/nvm.sh" ]] && \. "$NVM_DIR/nvm.sh"
66

7-
targetDir="/nut"
7+
if [[ $# -lt 1 ]]; then
8+
echo "No working directory provided, using default"
9+
targetDir=$PWD
10+
else
11+
targetDir=$1
12+
fi
13+
if [[ $# -lt 2 ]]; then
14+
echo "No node version provided, using default"
815
nodeVersion="lts/dubnium"
16+
else
17+
nodeVersion=$2
18+
fi
919

10-
echo "Entering working directory"
20+
echo "Entering working directory $targetDir"
1121
cd $targetDir
1222
echo "Installing node version $nodeVersion"
13-
nvm install lts/dubnium
23+
nvm install $nodeVersion
1424
echo "npm ci"
1525
npm ci > /dev/null 2>&1
1626
echo "git fetch --unshallow"

‎.travis.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ before_install:
2525
- sudo apt-get update
2626
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
2727
- docker pull s1hofmann/nut-ci:latest
28-
- docker run -it -d --name nut-ci --user $(id -u):$(id -g) -v ${PWD}:/nut:rw s1hofmann/nut-ci:latest bash
28+
- docker run -it -d --name nut-ci --user $(id -u):$(id -g) -v ${PWD}:${PWD}:rw s1hofmann/nut-ci:latest bash
2929

3030
install: true
3131

3232
script:
33-
- travis_retry docker exec nut-ci bash -c "bash /nut/.build/build.sh"
33+
- travis_retry docker exec nut-ci bash -c "bash /nut/.build/build.sh ${PWD} lts/dubnium"
3434

3535
after_success:
3636
- sonar-scanner

0 commit comments

Comments
 (0)