Skip to content

Commit 6c9c543

Browse files
authored
Feature/31/improve ci build (#32)
* Created build script * Updated Travis config * Updated build script * Re-added build essentials and libs * Log output * Removed empty install step * Disabled install step * Updated build script * Updated build script * Added retry * Removed sudo * Moved container start to script * Added Docker update step * Added Docker update step * Added write flag to mount * Using build user * Redirecting npm ci output, since logs are too long and crash the build * Removed port forward
1 parent 0d35d43 commit 6c9c543

2 files changed

Lines changed: 32 additions & 6 deletions

File tree

‎.build/build.sh‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
export NVM_DIR="$HOME/.nvm"
5+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
6+
7+
targetDir="/nut"
8+
nodeVersion="lts/dubnium"
9+
10+
echo "Entering working directory"
11+
cd $targetDir
12+
echo "Installing node version $nodeVersion"
13+
nvm install lts/dubnium
14+
echo "npm ci"
15+
npm ci > /dev/null 2>&1
16+
echo "npm run compile"
17+
npm run compile
18+
echo "npm run coverage"
19+
npm run coverage

‎.travis.yml‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,22 @@ addons:
1212
token:
1313
secure: "mOHkKrMl0msR9mjlkW30vcJ4R9hBZQiTrdJYFE+Islq0WT/W49RKPJmxyDiHwlBvGH483cWIuA3rC95hMZwjn2c0ybQ+M1gzkB/QKAv1FFy21Ze6H7EhFRGJ9x4fKQA2kZL3IwSMEm4ABbL5ZpcdijC2iSsFbxMXBVYhe7rHNz+rSqCPVbQV/OKc/lZeMRJ62DL2Mx6KXciO5Xq3rKANFM1yie8QLG8DNhcUv0OVtp65RDcOG30uqBOA1qDfq9VOylVKabVJN4ta2THr46ocYY1YfnUUDpcPJHQwZSL7Gl7BwMnMgiDGqZbWasJpqdlJSy6TesJGu8SI4ETWGwTE4jnrH3uegPXGqIdxOtWXPVR90U2upZ7/ztVVmABEAQN0zW0kv3Gwx2XbJ/Db4qc7OTNz5i9uf2BQ/dDEmjX4rMPYKbKFONHknq+e5dZiJGhmwC7ns7qaTIH23QZV9xyvC1ymbgbogdu17/bNvjZaPFtpnnFm49X/VWrf7Lw+rrGL62c7DHfJrYNHiky5OsQmlqyBq7Sm3O6pqtREdeZbgSAYdbn6ADIXbP7luhlSfM0oZ+GuPv3vGqapr41YVE70vs33ehLUDiDqY5F0sKDXLp4vvucupx2YSOx1KJDxaXmfAZAnL3/RVzGFByyGOeF8TQLV29T4cdPcl0wpbJcpmgI="
1414

15+
services:
16+
- docker
17+
1518
before_install:
19+
# Update Docker
20+
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
21+
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
1622
- sudo apt-get update
17-
- sudo apt-get install build-essential -y
18-
- sudo apt-get install libxt-dev libxtst-dev libxinerama-dev -y
23+
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
24+
- docker pull s1hofmann/nut-ci:latest
25+
- docker run -it -d --name nut-ci --user $(id -u):$(id -g) -v ${PWD}:/nut:rw s1hofmann/nut-ci:latest bash
1926

20-
install:
21-
- npm i
27+
install: true
2228

2329
script:
24-
- npm run compile
25-
- xvfb-run --server-args="-screen 0 1280x800x24" npm run coverage
30+
- travis_retry docker exec nut-ci bash -c "bash /nut/.build/build.sh"
31+
32+
after_success:
2633
- sonar-scanner

0 commit comments

Comments
 (0)