forked from mixbytes/haya
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.travis.yml
77 lines (68 loc) · 2.44 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
language: minimal
git:
depth: false
services:
- docker
before_install:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
cache:
directories:
- $HOME/.ccache
timeout: 1000
before_script:
- |
# project name
PROJ="${TRAVIS_REPO_SLUG##*/}"
PROJ="${PROJ,,}"
case "$PROJ" in
(haya) readonly ORG=mixbytes ;;
(daobet) readonly ORG=daocasino ;;
(*) echo >&2 "Bad project name: $PROJ." ; exit 1 ;;
esac
readonly PROJ="${PROJ,,}" # low case
# build-env image name
readonly BUILD_IMG="$ORG/$PROJ.build-env.$DISTRO"
#
- docker pull "$BUILD_IMG"
- |
if [[ "$TRAVIS_BRANCH" =~ ^debug- ]]; then
BUILD_TYPE="Debug"
else
BUILD_TYPE="RelWithDebInfo"
fi
- |
if [[ "$BUILD_TYPE" != Debug ]]; then
if [[ "$TRAVIS_PULL_REQUEST" == false ]]; then
TESTS="simulator|unit_test_wabt"
else
TESTS="simulator|unit_test_wabt|nodeos_sanity|nodeos_run"
fi
fi
script:
- ./cicd/docker-run package --build-type="${BUILD_TYPE}" --tests="$TESTS" --timeout=2400 "$DISTRO"
- |
if [[ "$DISTRO" == ubuntu ]]; then
./cicd/docker-run image "$ORG/$PROJ:$TRAVIS_BRANCH"
docker push "$ORG/$PROJ:$TRAVIS_BRANCH"
if [[ "$TRAVIS_BRANCH" == master ]]; then
docker tag "$ORG/$PROJ:master" "$ORG/$PROJ:latest"
docker push "$ORG/$PROJ:latest"
fi
fi
deploy:
provider: releases
api_key:
# github: Settings -> Developer settings -> Personal access tokens -> Generate new token
# in repo root: travis login ; travis encrypt <github token>
secure: "xUhriORtlo7hW+l6BDi7y6OkkWF+tpfLrK8nutcHRSTxglFDlpqRrEylzhMctcNdy0yYYbKHp7pSylATX0855ydyXvikyBCZ/6l7DtgikNbKHAWWv9BP61oQezH7Ij+DiKNxWprhKxhEl7CieubRRpnXZwnIvV+kaJBV6UEVmka3SPQ0qLNTIJaXF6vYCmlLZIlaF0hX76T2zGm3hu1kEQ4SEoSPFNEPv5ebfY5wV5XmOSnEqBjjzkOxpzayLT5PLTZEfLvP3kekGuqyQgJHDwvAdCoVO12JfQhWD2AaPrNSeTzDxL1QOZeG9hTeBAbReS0a0LEUdsZyvK72jDTTtJdgxL4CzQhDIAdNS8yP4xLQFSRM5xN0s7O31nl1obhinknWTZEah63n8PpPPfO4O5mIwJWnzlAQ3vHl2LeETur0vB7ghw9cvSiGd3u/ojVZROjluJbDOQVdxrqw2dTwCpriFqrGrY52lu5qSwcbUphpOfO4ZCmo2Wmw+Z1I9h+tQIya3r9toemYsfi8cmml1w50hRTdpcQkK7UPsHpw5R2u5JtdsDvOZ12iTpdSFhuxQwyQmi/JQpmMWgLXpZPHZMvKylVR55O9oe4GTNMfz91iA0+2rO79dukODf5HKiWqCvuLQKyFHyDyjDpiQLl1BjZx7SUwp3Ud4Y/hed6Vfnc="
file_glob: true
file: build/packages/*
skip_cleanup: true
overwrite: true
on:
tags: true
verbose: true
env:
matrix:
- "DISTRO=ubuntu"
- "DISTRO=centos"