-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
101 lines (92 loc) · 2.62 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
language: erlang
otp_release:
- 20.0
# It would be possible to use the container-based infrastructure if
# it ran trusty. However, it doesn't and wget is too old to use for
# HTTPS to buildroot.net.
sudo: required
dist: trusty
# Install dependencies
addons:
apt:
packages:
- bc
- libssl-dev
- squashfs-tools
# Cache downloaded files between builds
cache:
directories:
- $HOME/.nerves/cache/buildroot
env:
global:
- ELIXIR_VERSION=1.5.1
- FWUP_VERSION=0.15.4
- MIX_ENV=test
- NERVES_TARGET=rpi0
- CI_SYSTEM_NAME=nerves_system_$NERVES_TARGET
- REPO=nerves-project/$CI_SYSTEM_NAME
- NERVES_PACKAGE=`pwd`
- NERVES_FW_VCS_IDENTIFIER=$TRAVIS_COMMIT
- NERVES_FW_MISC=$TRAVIS_REPO_SLUG
before_install:
- wget https://github.com/fhunleth/fwup/releases/download/v${FWUP_VERSION}/fwup_${FWUP_VERSION}_amd64.deb
- sudo dpkg -i fwup_${FWUP_VERSION}_amd64.deb
- wget https://github.com/elixir-lang/elixir/releases/download/v$ELIXIR_VERSION/Precompiled.zip
- unzip -d elixir Precompiled.zip
before_script:
- export PATH=`pwd`/elixir/bin:$PATH
script:
- mix local.hex --force
- mix local.rebar --force
- mix deps.get
- mix archive.install https://github.com/nerves-project/archives/raw/master/nerves_bootstrap.ez --force
- mix compile
- cd test
- mix deps.get
- mix firmware
# Deploy the build products
before_deploy:
- cd $NERVES_PACKAGE/.nerves/artifacts/*
- make system
- cd $NERVES_PACKAGE
- $NERVES_PACKAGE/deps/nerves_system_br/scripts/ci-deploy.sh
- mkdir -p fw/signed
- cp $NERVES_PACKAGE/test/_build/test/nerves/images/*.fw fw/$NERVES_FW_VCS_IDENTIFIER.fw
- fwup --sign --private-key $NERVES_FW_PRIV_KEY -i fw/$NERVES_FW_VCS_IDENTIFIER.fw -o fw/signed/$NERVES_FW_VCS_IDENTIFIER.fw
deploy:
# Deploy tagged releases to GitHub
- provider: releases
api_key: $GITHUB_API_KEY
file:
- "artifacts/$CI_SYSTEM_NAME-$TRAVIS_TAG.tar.gz"
- "artifacts/$CI_SYSTEM_NAME-$TRAVIS_TAG.fw"
skip_cleanup: true
overwrite: true
on:
repo: $REPO
tags: true
- provider: s3
access_key_id: $S3_ID
secret_access_key: $S3_KEY
bucket: $S3_BUCKET
skip_cleanup: true
local_dir: artifacts
upload-dir: test
acl: public_read
on:
repo: $REPO
all_branches: true
- provider: s3
access_key_id: $S3_ID
secret_access_key: $S3_KEY
bucket: $S3_BUCKET
skip_cleanup: true
local_dir: fw/signed
upload-dir: test_server/$REPO
acl: public_read
on:
repo: $REPO
all_branches: true
# Display build log on failure
after_failure:
- tail -n 1000 $NERVES_PACKAGE/build.log