Newer
Older
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
#!/usr/bin/env bash
# ----------------------------------------------------------
# PURPOSE
# This is the test manager for epm to be ran from circle ci.
# It will run the testing sequence for eris-db using docker.
# ----------------------------------------------------------
# REQUIREMENTS
# docker installed locally
# docker-machine installed locally
# eris installed locally
# ----------------------------------------------------------
# USAGE
# circle_test.sh
# ----------------------------------------------------------
# Set defaults
uuid=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 12 | head -n 1)
machine="eris-test-edb-$uuid"
ver=$(cat version/version.go | tail -n 1 | cut -d ' ' -f 4 | tr -d '"')
start=`pwd`
# ----------------------------------------------------------
# Get machine sorted
echo "Setting up a Machine for eris-cm Testing"
docker-machine create --driver amazonec2 $machine 1>/dev/null
if [ "$?" -ne 0 ]
then
echo "Failed to create The Machine for eris-db Testing"
exit 1
fi
docker-machine scp tests/docker.sh ${machine}:
if [ "$?" -ne 0 ]
then
echo "Failed to copy the 'docker.sh' script into the container"
exit 1
fi
docker-machine ssh $machine sudo env DOCKER_VERSION=$DOCKER_VERSION '$HOME/docker.sh'
if [ "$?" -ne 0 ]
then
echo "Failed to install Docker client into the container"
exit 1
fi
eval $(docker-machine env $machine)
echo "Machine setup."
echo
docker version
echo
# ----------------------------------------------------------
# Run integration tests
tests/test.sh
test_exit=$?
# ----------------------------------------------------------
# Cleanup
echo
echo
echo "Cleaning up"
docker-machine rm --force $machine
cd $start
exit $test_exit