forked from fmartinou/teleinfo2mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
59 lines (44 loc) · 1.88 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
53
54
55
56
57
58
59
language: shell
os: linux
env:
global:
- NODE_VERSION=14
- CC_TEST_REPORTER_ID=5167fc209c026a59fa2f9e21c7e21efa2ce09989a62ca8bc775f2240d8b9f662
- DOCKER_CLI_EXPERIMENTAL=enabled
- IMAGE_VERSION=develop
before_install:
- export IMAGE_VERSION=${TRAVIS_BRANCH//\//\_}
- export IMAGE_VERSION=${IMAGE_VERSION//\#/\_}
# Install docker with buildx
- sudo rm -rf /var/lib/apt/lists/*
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- lsb_release -cs
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) edge"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- docker run --rm --privileged docker/binfmt:820fdd95a9972a5308930a2bdfb8573dd4447ad3
- cat /proc/sys/fs/binfmt_misc/qemu-aarch64
# 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