forked from JINWOO-J/prep_docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
86 lines (77 loc) · 2.39 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
language: python
python:
- "3.7"
#arch:
# - amd64
# - arm64
services:
- docker
env: # N times sandboxes created and built by jobs
global:
- IS_LOCAL=false
- CREP_ROOT_HASH="0x9718f5d6d6ddb77f547ecc7113c8f1bad1bf46220512fbde356eee74a90ba47c" #for mainnet
- WAIT_RETRY=30
- CURL_OPTION="--connect-timeout 1 --max-time 1 -s "
jobs:
include:
- os: linux
arch: amd64
env: IS_STATIC_BUILD="true"
- os: linux
arch: amd64
env: IS_STATIC_BUILD="false"
# - os: linux
# arch: arm64
# env: IS_STATIC_BUILD="true" ARCH="arm64"
# - os: linux
# arch: arm64
# env: IS_STATIC_BUILD="false" ARCH="arm64"
branches:
only:
- master
- devel
before_install:
- curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64 && chmod +x container-structure-test-linux-amd64 && sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
- >
scversion="stable" # or "v0.4.7", or "latest"
wget -qO- "https://storage.googleapis.com/shellcheck/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv
cp "shellcheck-${scversion}/shellcheck" /usr/local/bin/
shellcheck --version
install:
- |
if [[ "${ARCH}" == "arm64" ]]; then
make build_python_arm64 IS_LOCAL=$IS_LOCAL IS_STATIC_BUILD=$IS_STATIC_BUILD VERSION_ARG=$VERSION
else
make build_python IS_LOCAL=$IS_LOCAL IS_STATIC_BUILD=$IS_STATIC_BUILD VERSION_ARG=$VERSION
fi
- make test IS_LOCAL=$IS_LOCAL VERSION_ARG=$VERSION
- >
docker run -d --rm -p 9000:9000
-e CREP_ROOT_HASH=$CREP_ROOT_HASH
-e LOG_OUTPUT_TYPE="console"
-e IS_AUTOGEN_CERT="true"
--name prep-node iconloop/prep-node:$(make version)
script:
- docker ps -a
- |
NEXT_WAIT_TIME=0
until curl $CURL_OPTION localhost:9000/api/v1/status/peer || [ $NEXT_WAIT_TIME -eq $WAIT_RETRY ];
do
echo " retry count -> ${NEXT_WAIT_TIME}"
NEXT_WAIT_TIME=$(( NEXT_WAIT_TIME+1 ));
sleep 1;
done
- sleep 20
- docker ps -a
- peer_status=$(curl $CURL_OPTION http://localhost:9000/api/v1/status/peer)
- echo $peer_status | jq
- block_height=$(echo $peer_status | jq .block_height)
- |
if [[ "${block_height}" -gt 0 ]];then
echo "syncing .. $block_height"
else
echo "something wrong"
docker logs prep-node
exit 1
fi
after_failure: docker logs prep-node