run_build.sh 1.42 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/bash

# This script is to package the MDANSE package for Mac OS X

#############################
# CONFIGURATION
#############################

## Add some colors
ROUGE="\\033[1;31m"
BLEU="\\033[1;34m"

##Select the build target
14

15
16
17
# take the latest version of nmoldyn available on the forge
echo -e "$BLEU""Getting last MDANSE revision" "$NORMAL"

18
# Update the __pkginfo__ file with the current commit. The sed -i "" is compulsory other crashes on macos
19
COMMIT_ID=$(git rev-parse --short HEAD)
20
21
22
sed -i "" "s/.*__commit__.*/__commit__ = \"${COMMIT_ID}\"/" MDANSE/__pkginfo__.py

# Get revision number from git (without trailing newline)
23
echo -e "$BLEU""Commit id = ${COMMIT_ID}" "$NORMAL"
24
25
26
27
28
29
30
31
32

# Now build last version and install it in our homebrewed python
echo -e "$BLEU""Building MDANSE" "$NORMAL"

# Clean up temporary build directories
rm -rf build
rm -rf dist

# Remove previous install of MDANSE
33
34
35
rm /Library/Frameworks/Python.framework/Versions/2.7/bin/mdanse*
rm /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MDANSE*.egg-info
rm -rf /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/MDANSE
36
37

# Build and install MDANSE to the homebrewed python
38
/Library/Frameworks/Python.framework/Versions/2.7/bin/python setup.py build >> BuildServer/Darwin/Scripts/build_log.txt 2>&1
Remi Perenon's avatar
Remi Perenon committed
39
status=$?
Remi Perenon's avatar
Remi Perenon committed
40
41
42
43
44
45
if [ $status -ne 0 ]; then
	echo -e "$ROUGE" "Failed to build MDANSE" "$NORMAL"
	exit $status
fi

exit 0