-
Notifications
You must be signed in to change notification settings - Fork 18
/
.travis.yml
52 lines (37 loc) · 1.45 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
language: shell
os: linux
dist: jammy
env:
global:
- NODE_VERSION=18
- CC_TEST_REPORTER_ID=5167fc209c026a59fa2f9e21c7e21efa2ce09989a62ca8bc775f2240d8b9f662
- IMAGE_VERSION=develop
before_install:
- export IMAGE_VERSION=${TRAVIS_BRANCH//\//\_}
- export IMAGE_VERSION=${IMAGE_VERSION//\#/\_}
# Add qemu
- docker run --rm --privileged multiarch/qemu-user-static --credential yes --persistent yes
# Install Nodejs
- nvm install $NODE_VERSION
# Init Code Climate
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./app/cc-test-reporter
- (cd app && chmod +x ./cc-test-reporter)
- (cd app && ./cc-test-reporter before-build)
install:
# Install dependencies
- (cd app && npm ci)
# Run Linter
- (cd app && npm run lint)
# Run UT
- (cd app && npm test)
after_success:
# Report to Code Climate
- (cd app && ./cc-test-reporter after-build -t lcov --debug --exit-code $TRAVIS_TEST_RESULT)
# Override image version with latest if master branch
- if [ "$TRAVIS_BRANCH" == "master" ] ; then export IMAGE_VERSION=latest; fi
# Override image version with tag name if any
- if [ ! -z "$TRAVIS_TAG" ] ; then export IMAGE_VERSION=$TRAVIS_TAG; fi
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker version
- make prepare
- make build IMAGE_NAME=$DOCKER_USERNAME/teleinfo2mqtt IMAGE_VERSION=$IMAGE_VERSION PLATFORMS=linux/arm/v6,linux/arm/v7,linux/arm64/v8,linux/amd64