-
Notifications
You must be signed in to change notification settings - Fork 440
/
.travis.yml
45 lines (43 loc) · 1.54 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
language:
- c
compiler:
- gcc
cache:
directories:
- "${HOME}/.maixpy_cache"
env:
global:
- rev=$(git rev-parse --short HEAD)
- BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- curr_branch=$TRAVIS_BRANCH
branches:
only:
- master
stages:
- name: maixpy_build
jobs:
include:
- stage: maixpy_build
env: NAME="maixpy build"
install:
- sudo apt-get update
- sudo apt-get install -y sshpass p7zip-full
- wget https://github.com/kendryte/kendryte-gnu-toolchain/releases/download/v8.2.0-20190409/kendryte-toolchain-ubuntu-amd64-8.2.0-20190409.tar.xz
- sudo tar -Jxf kendryte-toolchain-ubuntu-amd64-8.2.0-20190409.tar.xz -C /opt
- rm -f kendryte-toolchain-ubuntu-amd64-8.2.0-20190409.tar.xz
script:
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, BRANCH=$BRANCH"
- cd tools/release
- chmod +x release.sh && ./release.sh || travis_terminate 1;
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then exit 0; fi
- time_now=$(date "+%Y_%m_%d_%H_%M_%S")
- cd bin
- firmware_dir=`ls`
- sudo sh -c "echo StrictHostKeyChecking no >>/etc/ssh/ssh_config"
- chmod -R 777 $firmware_dir
- SSHPATH="$HOME/.ssh"
- rm -rf "$SSHPATH"
- mkdir -p "$SSHPATH"
- echo "${ACCESS_KEY}" > "$SSHPATH/id_rsa"
- chmod 600 "$SSHPATH/id_rsa"
- rsync -av --progress $firmware_dir ${SERVER_USER}@${SERVER_ADDR}:${SERVER_FOLDER_PATH}/${curr_branch}/