-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild_linux.sh
More file actions
109 lines (85 loc) · 2.46 KB
/
Copy pathbuild_linux.sh
File metadata and controls
109 lines (85 loc) · 2.46 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
echo "------------------------------------"
echo "Cleaning workspace"
echo "------------------------------------"
# TODO JT 2014-02-13 - Should clean the workspace
rm -rf src/build
rm -rf *.dmg
rm -f src/VERSION.py
rm -f version.properties
rm -rf src/dist
rm -rf PeachyRaster.egg-info
rm -rf PeachyRaster*.tar.gz
rm -rf venv
echo "------------------------------------"
echo "Setting up environment"
echo "------------------------------------"
if [[ "$VIRTUAL_ENV" != "" ]]; then
echo "Deactivitate the existing virtual enviroment before running this script."
echo "This can be done with the \"deactivate\" command."
exit 53
fi
virtualenv venv
if [ $? != 0 ]; then
echo "Virutal environment failed"
exit 59
fi
source venv/bin/activate
echo "------------------------------------"
echo "Extracting Git Revision Number"
echo "------------------------------------"
SEMANTIC=`cat symantic.version`
function trim() { echo $1; }
if [ -z $GIT_HOME ]; then
if [ -f "/usr/local/bin/git" ]; then
export GIT_HOME=/usr/local/bin/git
elif [ -f "/usr/bin/git" ]; then
export GIT_HOME=/usr/bin/git
elif [ -f "/bin/git" ]; then
export GIT_HOME=/bin/git
else
echo "Could not find git."
exit 1
fi
fi
export GIT_REV_COUNT_RAW=`$GIT_HOME log --pretty=oneline | wc -l`
export GIT_REV_COUNT=`trim $GIT_REV_COUNT_RAW`
export GIT_REV=`$GIT_HOME rev-parse HEAD`
VERSION=$SEMANTIC.$TAG$GIT_REV_COUNT
echo "Version: $VERSION"
echo "# THIS IS A GENERATED FILE " > version.properties
echo "version='$VERSION'" >> version.properties
echo "revision='$GIT_REV'" >> version.properties
echo "Git Revision Number is $GIT_REV_COUNT"
cp version.properties src/VERSION.py
echo "------------------------------------"
echo "PACKAGING"
echo "------------------------------------"
cd src
python setup.py sdist
if [ $? != 0 ]; then
echo "FAILED PACKAGING ABORTING"
exit 56
fi
pip install dist/PeachyRaster-$VERSION.tar.gz
cd ..
echo "------------------------------------"
echo "Running Tests"
echo `python2.7 --version`
echo "------------------------------------"
pip install mock
python test/test-all.py
if [ $? != 0 ]; then
echo "FAILED TESTS ABORTING"
exit 55
fi
echo "TESTS COMPLETE SUCCESS"
echo "PACKAGING COMPLETE SUCCESS"
mv src/dist/PeachyRaster*.tar.gz .
if [ $? != 0 ]; then
echo "FAILED MOVE PACKAGE ABORTING"
exit 57
fi
echo "------------------------------------"
echo "COMPLETE SUCCESS"
echo "------------------------------------"