-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdeploy.sh
executable file
·77 lines (64 loc) · 1.74 KB
/
deploy.sh
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
#!/bin/bash
set -e
clear
if [ "$1" == "coverage" ]; then
echo "** Killing old ganache"
scripts/linux/kill.sh ganache-cli
echo "** Running coverage"
scripts/linux/coverage.sh SKIP_ASSERTS
exit 0
fi
if [ "$ETH_truffleNetwork" == "" ]; then
export ETH_truffleNetwork="development"
fi
echo "** Using truffle network $ETH_truffleNetwork"
if [ "$ETH_truffleSkipMigrate" != "skip" ]; then
if [ "$ETH_truffleNetwork" == "development" ]; then
echo "** Killing old ganache"
scripts/linux/kill.sh ganache-cli
# Mnemonic is mandatory for testing with Scala; we may as well use it too.
echo "** Starting new ganache"
gnome-terminal -- ganache-cli -l 8000000 -m "provide indoor friend weasel side early tumble assist wrong afraid notice earth plug mad tip"
fi
rm -rf build
echo "** Compiling"
truffle compile
export migrationLog=migrationLog-$ETH_truffleNetwork.txt
if [ "$1" != "test" ]; then
echo "** Migrating"
date > $migrationLog
truffle --network $ETH_truffleNetwork migrate --reset | tee -a $migrationLog
date >> $migrationLog
fi
fi
if [ "$1" == "test" ]; then
truffle --network $ETH_truffleNetwork test $2
exit 0
fi
if [ "$1" == "api" ]; then
echo "** Running api tests"
pushd api
npm run test
popd
exit 0
fi
if [ "$1" == "aventus4s" ]; then
echo "** Running aventus4s build"
pushd ../scripts/protocol
rm -rf ./out
rm -rf ./protocol-tmp
echo "*** generate-java-contracts..."
bash ./generate-java-contracts.sh "../../protocol/" "./out"
cp -r ./out/io ../../aventus4s/src/main/java
popd
fi
if [ "$1" != "" ]; then
echo "** Running $1 tests"
pushd ../$1
echo "*** Unit tests..."
sbt test
echo "*** Integration tests..."
sbt it:test
popd
exit 0
fi