Commit c117286e authored by eric pellegrini's avatar eric pellegrini
Browse files

Merge branch 'feature-sphinx_doc' into 'develop'

Feature sphinx doc

See merge request !26
parents 017616ad fdb9294c
Pipeline #4229 passed with stages
in 36 minutes and 53 seconds
...@@ -6,8 +6,9 @@ if sys.platform.startswith('darwin'): ...@@ -6,8 +6,9 @@ if sys.platform.startswith('darwin'):
from setuptools import setup from setuptools import setup
version = os.environ['VERSION_NAME'] version = os.environ['VERSION_NAME']
project_dir = os.environ['CI_PROJECT_DIR']
APP = ['../../Scripts/mdanse_gui'] APP = [os.path.join(project_dir,'Scripts','mdanse_gui')]
PLIST = { PLIST = {
u'CFBundleName': u'MDANSE', u'CFBundleName': u'MDANSE',
...@@ -17,14 +18,14 @@ if sys.platform.startswith('darwin'): ...@@ -17,14 +18,14 @@ if sys.platform.startswith('darwin'):
u'LSApplicationCategoryType': u'public.app-category.science' u'LSApplicationCategoryType': u'public.app-category.science'
} }
OPTIONS = { OPTIONS = {
'argv_emulation': False,# has to be False otherwise triggers problems zith wxPython which lose some events that are captured by OS 'argv_emulation': False,# has to be False otherwise triggers problems with wxPython which lose some events that are captured by OS
'iconfile': u'../../MDANSE/GUI/Icons/mdanse.icns', 'iconfile': os.path.join(project_dir,'MDANSE','GUI','Icons','mdanse.icns'),
'excludes': 'PyQt4', 'excludes': 'PyQt4',
'matplotlib_backends': '-', 'matplotlib_backends': '-',
'optimize': '1', 'optimize': '1',
'plist': PLIST, 'plist': PLIST,
'bdist_base': './Build_macOS/build', 'bdist_base': os.environ['CI_TEMP_BUILD_DIR'],
'dist_dir': './Build_macOS/dist', 'dist_dir': os.path.join(os.environ['CI_TEMP_DIR'],'dist'),
'graph': False, 'graph': False,
'xref': False, 'xref': False,
'packages' : ["MDANSE","MMTK","Scientific"] 'packages' : ["MDANSE","MMTK","Scientific"]
......
#!/bin/bash #!/bin/bash
files=`ls $MACOS_ROOT_DIR/dist/MDANSE.app/Contents/Frameworks/libwx*.dylib` files=`ls ${MDANSE_APP_DIR}/Contents/Frameworks/libwx*.dylib`
libs="osx_cocoau_xrc osx_cocoau_webview osx_cocoau_html osx_cocoau_qa osx_cocoau_adv osx_cocoau_core baseu_xml baseu_net baseu" libs="osx_cocoau_xrc osx_cocoau_webview osx_cocoau_html osx_cocoau_qa osx_cocoau_adv osx_cocoau_core baseu_xml baseu_net baseu"
......
export ARCH=amd64
export DISTRO=macOS
export PYTHONEXE=/usr/bin/python
# The sed -i"" is compulsory other crashes on macos
export SED_I_COMMAND=(sed -i "")
...@@ -9,79 +9,88 @@ export DISTUTILS_DEBUG=0 ...@@ -9,79 +9,88 @@ export DISTUTILS_DEBUG=0
############################# #############################
# PREPARATION # PREPARATION
############################# #############################
cd ${MDANSE_SOURCE_DIR} cd ${CI_PROJECT_DIR}
rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}/build
rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist export MDANSE_APP_DIR=${CI_TEMP_DIR}/dist/MDANSE.app
export PYTHONPATH=${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages:${PYTHONPATH}
# Build API
${PYTHONEXE} setup.py build_api build_help install --prefix=${CI_TEMP_INSTALL_DIR}
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to build MDANSE Documentation""${NORMAL}"
exit $status
fi
############################# #############################
# PACKAGING # PACKAGING
############################# #############################
echo -e "${BLUE}""Packaging MDANSE""${NORMAL}" echo -e "${BLUE}""Packaging MDANSE""${NORMAL}"
MDANSE_DMG=MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.dmg MDANSE_DMG=MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.dmg
rm -f BuildServer/Unix/${MDANSE_DMG}
rm -f BuildServer/Unix/rw.${MDANSE_DMG}
cd BuildServer/Unix cd ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS
${PYTHONEXE} MacOS_resources/build.py py2app ${PYTHONEXE} build.py py2app
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
echo -e "${RED}" "Cannot build app.""${NORMAL}" echo -e "${RED}" "Cannot build app.""${NORMAL}"
exit $status exit $status
fi fi
#Add MDANSE version file (should read the version from the bundle with pyobjc, but will figure that out later) # Add MDANSE version file (should read the version from the bundle with pyobjc, but will figure that out later)
echo "${VERSION_NAME}" > ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/version echo "${VERSION_NAME}" > ${MDANSE_APP_DIR}/Contents/Resources/version
############################# #############################
# Copying Python # Copying Python
############################# #############################
### When launching the bundle, the executable target (i.e. MDANSE) modify the python that is shipped with the bundle (si.e. package path, dylib dependencies ...) ### When launching the bundle, the executable target (i.e. MDANSE) modify the python that is shipped with the bundle (si.e. package path, dylib dependencies ...)
### see http://joaoventura.net/blog/2016/embeddable-python-osx/ for technical details ### see http://joaoventura.net/blog/2016/embeddable-python-osx/ for technical details
### In our case we also want the user to be able to start directly python without launching the bundle executable (e.g. to run scripts in command line) which is the reason ### In our case we also want the user to be able to start directly python without launching the bundle executable (e.g. to run scripts in command line) which is the reason
### why we have to modify the python executable appropriately with the following commands ### why we have to modify the python executable appropriately with the following commands
rm ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/MacOS/python rm ${MDANSE_APP_DIR}/Contents/MacOS/python
mkdir ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/bin mkdir -p ${MDANSE_APP_DIR}/Contents/Resources/bin
cp /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/bin/python cp /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ${MDANSE_APP_DIR}/Contents/Resources/bin/python
cp -r /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/* ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/lib/python2.7/ cp -r /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/* ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/
cp /System/Library/Frameworks/Python.framework/Versions/2.7/Python ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/lib/libpython2.7.dylib cp /System/Library/Frameworks/Python.framework/Versions/2.7/Python ${MDANSE_APP_DIR}/Contents/Resources/lib/libpython2.7.dylib
chmod 777 ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/lib/libpython2.7.dylib chmod 777 ${MDANSE_APP_DIR}/Contents/Resources/lib/libpython2.7.dylib
install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python @executable_path/../lib/libpython2.7.dylib ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/bin/python install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python @executable_path/../lib/libpython2.7.dylib ${MDANSE_APP_DIR}/Contents/Resources/bin/python
install_name_tool -id @loader_path/libpython2.7.dylib ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/lib/libpython2.7.dylib install_name_tool -id @loader_path/libpython2.7.dylib ${MDANSE_APP_DIR}/Contents/Resources/lib/libpython2.7.dylib
ln -s ../Resources/bin/python ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/MacOS/python ln -s ../Resources/bin/python ${MDANSE_APP_DIR}/Contents/MacOS/python
# Do some manual cleanup, e.g. # Do some manual cleanup, e.g.
rm ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/lib/python2.7/MDANSE/__pkginfo__.py\"\"
# matplotlib/tests ==> 45.2 Mb # matplotlib/tests ==> 45.2 Mb
#rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/lib/python2.7/matplotlib/tests #rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/matplotlib/tests
#rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/mpl-data/sample_data #rm -rf ${MDANSE_APP_DIR}/Contents/Resources/mpl-data/sample_data
#rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/lib/python2.7/scipy #rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/scipy
#rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Resources/lib/python2.7/zmq #rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/zmq
#mkdir ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework #mkdir ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework
#mkdir ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions #mkdir ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions
#mkdir ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7 #mkdir ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7
#mkdir ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib #mkdir ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/lib
#cp -r /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7 #cp -r /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7
#rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/* #rm -rf ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/*
#rm ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/MacOS/python #rm ${MDANSE_APP_DIR}/Contents/MacOS/python
#cp /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/MacOS/python #cp /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ${MDANSE_APP_DIR}/Contents/MacOS/python
#cp /System/Library/Frameworks/Python.framework/Versions/2.7/Python ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib #cp /System/Library/Frameworks/Python.framework/Versions/2.7/Python ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib
#install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python @executable_path/../Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/MacOS/python #install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python @executable_path/../Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib ${MDANSE_APP_DIR}/Contents/MacOS/python
#chmod 777 ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib #chmod 777 ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib
#install_name_tool -id @executable_path/../Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib #install_name_tool -id @executable_path/../Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/libpython2.7.dylib
## In order that the modified python in the bundle import the zipped sitepackages located in Contents/Resources we provide a modified site.py that will ## In order that the modified python in the bundle import the zipped sitepackages located in Contents/Resources we provide a modified site.py that will
## update the sys.path accordingly ## update the sys.path accordingly
#cp ${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources/site.py ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist/MDANSE.app/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/. #cp ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/site.py ${MDANSE_APP_DIR}/Contents/Frameworks/Python.framework/Versions/2.7/lib/python2.7/.
chmod 777 ${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources//change_dylib_path.sh chmod 777 ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/change_dylib_path.sh
${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources//change_dylib_path.sh ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/change_dylib_path.sh
############################# #############################
# Create DMG # Create DMG
...@@ -89,7 +98,6 @@ ${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources//change_dylib_path.sh ...@@ -89,7 +98,6 @@ ${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources//change_dylib_path.sh
hdiutil unmount /Volumes/MDANSE -force -quiet hdiutil unmount /Volumes/MDANSE -force -quiet
sleep 5 sleep 5
${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources/dmg/create-dmg --background "${MDANSE_SOURCE_DIR}/BuildServer/Unix/MacOS_resources/dmg/dmg_background.jpg" --volname "MDANSE" --window-pos 200 120 --window-size 800 400 --icon MDANSE.app 200 190 --hide-extension MDANSE.app --app-drop-link 600 185 "${MDANSE_DMG}" ${MDANSE_TEMPORARY_INSTALLATION_DIR}/dist ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/Resources/dmg/create-dmg --background "${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/Resources/dmg/dmg_background.jpg" --volname "MDANSE" --window-pos 200 120 --window-size 800 400 --icon MDANSE.app 200 190 --hide-extension MDANSE.app --app-drop-link 600 185 "${MDANSE_DMG}" ${CI_TEMP_DIR}/dist
mv ${MDANSE_SOURCE_DIR}/BuildServer/Unix/${MDANSE_DMG} ${MDANSE_SOURCE_DIR} mv ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/${MDANSE_DMG} ${CI_PROJECT_DIR}
rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}
\ No newline at end of file
#!/bin/bash #!/bin/bash
############################# cd ${CI_PROJECT_DIR}
# PREPARATION
#############################
rm -rf build
# Create the temporary directory where ScientificPython, MMTK and MDANSE will be installed
rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}
mkdir ${MDANSE_TEMPORARY_INSTALLATION_DIR}
############################# #############################
# BUILDING DEPENDENCIES # BUILDING DEPENDENCIES
############################# #############################
# Build ILL version of ScientificPython # Build ILL version of ScientificPython
echo -e "${BLUE}""Building ScientificPython""${NORMAL}" echo -e "${BLUE}""Building ScientificPython""${NORMAL}"
cd /tmp
rm -rf scientific-python rm -rf scientific-python
git clone https://code.ill.fr/scientific-software/scientific-python.git git clone https://code.ill.fr/scientific-software/scientific-python.git
cd scientific-python cd scientific-python
git checkout master git checkout master
${PYTHONEXE} setup.py build
status=$? ${PYTHONEXE} setup.py install --prefix=${CI_TEMP_INSTALL_DIR}
if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to build Scientific""${NORMAL}"
exit $status
fi
${PYTHONEXE} setup.py install --prefix=${MDANSE_TEMPORARY_INSTALLATION_DIR}
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to install Scientific""${NORMAL}" echo -e "${RED}" "Failed to build/install Scientific""${NORMAL}"
exit $status exit $status
fi fi
export NETCDF_HEADER_FILE_PATH=${MDANSE_TEMPORARY_INSTALLATION_DIR}/include/python2.7/
cp ${NETCDF_HEADER_FILE_PATH}/Scientific/netcdf.h ${NETCDF_HEADER_FILE_PATH} cp ${CI_TEMP_INSTALL_DIR}/include/python2.7/Scientific/netcdf.h ${CI_TEMP_INSTALL_DIR}/include/python2.7/
cd ${CI_PROJECT_DIR}
# Build ILL version of MMTK # Build ILL version of MMTK
echo -e "${BLUE}""Building MMTK""${NORMAL}" echo -e "${BLUE}""Building MMTK""${NORMAL}"
cd /tmp
rm -rf mmtk rm -rf mmtk
git clone https://code.ill.fr/scientific-software/mmtk.git git clone https://code.ill.fr/scientific-software/mmtk.git
cd mmtk cd mmtk
git checkout master git checkout master
${PYTHONEXE} setup.py build
status=$? # Env var needed by MMTK
if [ $status -ne 0 ]; then export NETCDF_HEADER_FILE_PATH=${CI_TEMP_INSTALL_DIR}/include/python2.7/
echo -e "${RED}" "Failed to build MMTK""${NORMAL}"
exit $status ${PYTHONEXE} setup.py install --prefix=${CI_TEMP_INSTALL_DIR}
fi
${PYTHONEXE} setup.py install --prefix=${MDANSE_TEMPORARY_INSTALLATION_DIR}
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to install MMTK""${NORMAL}" echo -e "${RED}" "Failed to build/install MMTK""${NORMAL}"
exit $status exit $status
fi fi
...@@ -58,20 +44,15 @@ fi ...@@ -58,20 +44,15 @@ fi
# MDANSE Building # MDANSE Building
############################# #############################
echo -e "${BLUE}""Building MDANSE""${NORMAL}" echo -e "${BLUE}""Building MDANSE""${NORMAL}"
cd $MDANSE_SOURCE_DIR
cd ${CI_PROJECT_DIR}
# Now build last version and install it # Now build last version and install it
${PYTHONEXE} setup.py build ${PYTHONEXE} setup.py install --prefix=${CI_TEMP_INSTALL_DIR}
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to build MDANSE""${NORMAL}" echo -e "${RED}" "Failed to build MDANSE""${NORMAL}"
exit $status exit $status
fi fi
${PYTHONEXE} setup.py install --prefix=${MDANSE_TEMPORARY_INSTALLATION_DIR}
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to install MDANSE""${NORMAL}"
exit $status
fi
rm -rf build
\ No newline at end of file
#!/bin/bash
#############################
# PREPARATION
#############################
cd ${MDANSE_SOURCE_DIR}
#############################
# UNITARY TESTS
#############################
echo -e "${BLUE}""Cleaning repository""${NORMAL}"
rm -rf /tmp/mmtk
rm -rf /tmp/scientific-python
rm -rf MDANSE_TEMPORARY_INSTALLATION_DIR
rm -rf build
rm -rf BuildServer/Build_Debian
rm -rf BuildServer/Build_macOS
rm -rf BuildServer/Unix/Build_Debian
rm -rf BuildServer/Unix/Build_macOS
rm -rf *.deb
rm -rf *.dmg
\ No newline at end of file
export ARCH=amd64
export DISTRO=$(lsb_release -c | cut -f2)
export PYTHONEXE=/usr/bin/python
# The sed -i"" is compulsory other crashes on macos
export SED_I_COMMAND='sed -i'
export MDANSE_SOURCE_DIR=$(pwd)
export MDANSE_TEMPORARY_INSTALLATION_DIR=${MDANSE_SOURCE_DIR}/BuildServer/Unix/Build_Debian
export PYTHONPATH=${MDANSE_TEMPORARY_INSTALLATION_DIR}/lib/python2.7/site-packages/:${PYTHONPATH}
export RED="\\033[1;31m"
export BLUE="\\033[1;34m"
export NORMAL="\\033[0m"
# Get revision number from Git
export MDANSE_GIT_CURRENT_COMMIT=$(git rev-parse --short HEAD)
# Get commit branch from Gitlab
export MDANSE_GIT_BRANCH_NAME="$1"
\ No newline at end of file
export ARCH=amd64
export DISTRO=macOS
export PYTHONEXE=/usr/bin/python
# The sed -i"" is compulsory other crashes on macos
export SED_I_COMMAND='sed -i ""'
export MDANSE_SOURCE_DIR=$(pwd)
export MDANSE_TEMPORARY_INSTALLATION_DIR=${MDANSE_SOURCE_DIR}/BuildServer/Unix/Build_macOS
export PYTHONPATH=${MDANSE_TEMPORARY_INSTALLATION_DIR}/lib/python2.7/site-packages/:${PYTHONPATH}
export MDANSE_DEPENDENCIES_DIR=/Users/ci/Projects/mdanse/dependencies
export RED="\\033[1;31m"
export BLUE="\\033[1;34m"
export NORMAL="\\033[0m"
# Get revision number from Git
export MDANSE_GIT_CURRENT_COMMIT=$(git rev-parse --short HEAD)
# Get commit branch from Gitlab
export MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME}
\ No newline at end of file
#!/bin/bash
if [ -z ${CI_PROJECT_DIR} ]; then
export CI_PROJECT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
fi
export CI_TEMP_DIR=${CI_PROJECT_DIR}/temp
export CI_TEMP_BUILD_DIR=${CI_PROJECT_DIR}/temp/build
export CI_TEMP_BUILD_DIR=${CI_PROJECT_DIR}/build
export CI_TEMP_INSTALL_DIR=${CI_PROJECT_DIR}/temp/install
export PYTHONPATH=${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages/:${PYTHONPATH}
mkdir -p ${CI_TEMP_DIR}
cd ${CI_PROJECT_DIR}
# Get revision number from Git
if [ -z ${CI_COMMIT_SHA} ]; then
export CI_COMMIT_ID=$(git rev-parse HEAD)
else
export CI_COMMIT_ID=${CI_COMMIT_SHA}
fi
export CI_COMMIT_ID=${CI_COMMIT_ID:0:8}
# Get commit branch from Gitlab
if [ -z ${CI_COMMIT_REF_NAME} ]; then
CI_COMMIT_REF_NAME=$(git show -s --pretty=%d HEAD)
CI_COMMIT_REF_NAME=$(echo ${CI_COMMIT_REF_NAME} | rev | cut -d, -f1 | cut -c2- | cut -d/ -f1 | rev)
export CI_COMMIT_REF_NAME
fi
export RED="\\033[1;31m"
export BLUE="\\033[1;34m"
export NORMAL="\\033[0m"
echo -e "${BLUE}""Commit id = ${CI_COMMIT_ID}""${NORMAL}"
echo -e "${BLUE}""Branch name = ${CI_COMMIT_REF_NAME}""${NORMAL}"
PKG_INFO=${CI_PROJECT_DIR}/MDANSE/__pkginfo__.py
# Update the __pkginfo__ file with the current commit
"${SED_I_COMMAND[@]}" "s/.*__commit__.*/__commit__ = \"${CI_COMMIT_ID}\"/" ${PKG_INFO}
# Get MDANSE version
MDANSE_VERSION=`sed -n 's/__version__.*=.*\"\(.*\)\"/\1/p' ${PKG_INFO}`
# Check if branch is master
if [[ ${CI_COMMIT_REF_NAME} == "master" ]]
then
VERSION_NAME=${MDANSE_VERSION}
"${SED_I_COMMAND[@]}" "s/.*__beta__.*/__beta__ = None/" ${PKG_INFO}
else
# Check if branch is release*
if [[ ${CI_COMMIT_REF_NAME::7} == "release" ]]
then
VERSION_NAME=${MDANSE_VERSION}-rc-${CI_COMMIT_ID}
"${SED_I_COMMAND[@]}" "s/.*__beta__.*/__beta__ = \"rc\"/" ${PKG_INFO}
else
VERSION_NAME=${MDANSE_VERSION}-beta-${CI_COMMIT_ID}
"${SED_I_COMMAND[@]}" "s/.*__beta__.*/__beta__ = \"beta\"/" ${PKG_INFO}
fi
fi
export VERSION_NAME
...@@ -3,39 +3,38 @@ ...@@ -3,39 +3,38 @@
############################# #############################
# PREPARATION # PREPARATION
############################# #############################
cd ${MDANSE_SOURCE_DIR}
export PYTHONPATH=${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages:${PYTHONPATH}
############################# #############################
# UNITARY TESTS # UNITARY TESTS
############################# #############################
echo -e "${BLUE}""Performing unitary tests""${NORMAL}" echo -e "${BLUE}""Performing unitary tests""${NORMAL}"
cd Tests/UnitTests cd ${CI_PROJECT_DIR}/Tests/UnitTests
${PYTHONEXE} AllTests.py ${PYTHONEXE} AllTests.py
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
echo -e "${RED}" "One or several unit tests failed" echo -e "${RED}" "One or several unit tests failed"
exit $status exit $status
fi fi
cd ${MDANSE_SOURCE_DIR}
############################# #############################
# DEPENDENCIES TESTS # DEPENDENCIES TESTS
############################# #############################
echo -e "${BLUE}""Performing dependencies tests""${NORMAL}" echo -e "${BLUE}""Performing dependencies tests""${NORMAL}"
cd Tests/DependenciesTests cd ${CI_PROJECT_DIR}/Tests/DependenciesTests
${PYTHONEXE} AllTests.py ${PYTHONEXE} AllTests.py
status=$? status=$?
if [ $status -ne 0 ]; then if [ $status -ne 0 ]; then
echo -e "${RED}" "One or several dependencies tests failed" echo -e "${RED}" "One or several dependencies tests failed"
exit $status exit $status
fi fi
cd ${MDANSE_SOURCE_DIR}
############################# #############################
# FUCNTIONAL TESTS # FUCNTIONAL TESTS
############################# #############################
echo -e "${BLUE}""Performing functional tests""${NORMAL}" echo -e "${BLUE}""Performing functional tests""${NORMAL}"
cd Tests/FunctionalTests/Jobs cd ${CI_PROJECT_DIR}/Tests/FunctionalTests/Jobs
rm -rf Test_* rm -rf Test_*
${PYTHONEXE} BuildJobTests.py ${PYTHONEXE} BuildJobTests.py
${PYTHONEXE} AllTests.py ${PYTHONEXE} AllTests.py
...@@ -44,4 +43,4 @@ if [ $status -ne 0 ]; then ...@@ -44,4 +43,4 @@ if [ $status -ne 0 ]; then
echo -e "${RED}" "One or several functional tests failed" echo -e "${RED}" "One or several functional tests failed"
exit $status exit $status
fi fi
cd ${MDANSE_SOURCE_DIR}
\ No newline at end of file
#!/bin/bash
cd $MDANSE_SOURCE_DIR
# Update the __pkginfo__ file with the current commit
echo -e "${BLUE}""Commit id = ${MDANSE_GIT_CURRENT_COMMIT}<--""${NORMAL}"
echo -e "${BLUE}""Branch name = ${MDANSE_GIT_BRANCH_NAME}<--""${NORMAL}"
$SED_I_COMMAND "s/.*__commit__.*/__commit__ = \"${MDANSE_GIT_CURRENT_COMMIT}\"/" MDANSE/__pkginfo__.py
# Get MDANSE version
MDANSE_VERSION=`sed -n 's/__version__.*=.*\"\(.*\)\"/\1/p' MDANSE/__pkginfo__.py`
# Check if branch is master
if [[ ${MDANSE_GIT_BRANCH_NAME} == "master" ]]
then
VERSION_NAME=${MDANSE_VERSION}
$SED_I_COMMAND "s/.*__beta__.*/__beta__ = None/" MDANSE/__pkginfo__.py
else
# Check if branch is release*
if [[ ${MDANSE_GIT_BRANCH_NAME::7} == "release" ]]
then
VERSION_NAME=${MDANSE_VERSION}-rc-${MDANSE_GIT_CURRENT_COMMIT}
$SED_I_COMMAND "s/.*__beta__.*/__beta__ = \"rc\"/" MDANSE/__pkginfo__.py
else
VERSION_NAME=${MDANSE_VERSION}-beta-${MDANSE_GIT_CURRENT_COMMIT}
$SED_I_COMMAND "s/.*__beta__.*/__beta__ = \"beta\"/" MDANSE/__pkginfo__.py
fi
fi
export VERSION_NAME
\ No newline at end of file