Commit c117286e authored by eric pellegrini's avatar eric pellegrini

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
......@@ -2,7 +2,7 @@ stages:
- docker_login
- ci
- deploy
- clean
- docker_logout
docker_login:
stage: docker_login
......@@ -19,7 +19,7 @@ docker_login:
ci:ubuntu_trusty:
stage: ci
script:
- docker build --force-rm --build-arg MDANSE_GIT_COMMIT=${CI_COMMIT_SHA} --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t ci_mdanse_trusty -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-trusty/Dockerfile_build .
- docker build --force-rm --build-arg MDANSE_GIT_COMMIT=${CI_COMMIT_SHA} -t ci_mdanse_trusty -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-trusty/Dockerfile_build .
allow_failure: false
tags:
- docker
......@@ -29,7 +29,7 @@ ci:ubuntu_trusty:
deploy:ubuntu_trusty:
stage: deploy
script:
- docker build --force-rm --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t deploy_mdanse_trusty -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-trusty/Dockerfile_deploy .
- docker build --force-rm -t deploy_mdanse_trusty -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-trusty/Dockerfile_deploy .
- chmod 755 ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh
- ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh trusty
dependencies:
......@@ -57,7 +57,7 @@ deploy:ubuntu_trusty:
ci:ubuntu_xenial:
stage: ci
script:
- docker build --force-rm --build-arg MDANSE_GIT_COMMIT=${CI_COMMIT_SHA} --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t ci_mdanse_xenial -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-xenial/Dockerfile_build .
- docker build --force-rm --build-arg MDANSE_GIT_COMMIT=${CI_COMMIT_SHA} -t ci_mdanse_xenial -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-xenial/Dockerfile_build .
allow_failure: false
tags:
- docker
......@@ -67,7 +67,7 @@ ci:ubuntu_xenial:
deploy:ubuntu_xenial:
stage: deploy
script:
- docker build --force-rm --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t deploy_mdanse_xenial -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-xenial/Dockerfile_deploy .
- docker build --force-rm -t deploy_mdanse_xenial -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-xenial/Dockerfile_deploy .
- chmod 755 ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh
- ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh xenial
dependencies:
......@@ -95,7 +95,7 @@ deploy:ubuntu_xenial:
ci:ubuntu_bionic:
stage: ci
script:
- docker build --force-rm --build-arg MDANSE_GIT_COMMIT=${CI_COMMIT_SHA} --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t ci_mdanse_bionic -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-bionic/Dockerfile_build .
- docker build --force-rm --build-arg MDANSE_GIT_COMMIT=${CI_COMMIT_SHA} -t ci_mdanse_bionic -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-bionic/Dockerfile_build .
allow_failure: false
tags:
- docker
......@@ -105,7 +105,7 @@ ci:ubuntu_bionic:
deploy:ubuntu_bionic:
stage: deploy
script:
- docker build --force-rm --build-arg MDANSE_GIT_BRANCH_NAME=${CI_COMMIT_REF_NAME} -t deploy_mdanse_bionic -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-bionic/Dockerfile_deploy .
- docker build --force-rm -t deploy_mdanse_bionic -f ${CI_PROJECT_DIR}/BuildServer/Docker/Builder/Ubuntu-bionic/Dockerfile_deploy .
- chmod 755 ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh
- ${CI_PROJECT_DIR}/BuildServer/Docker/upload_artefacts.sh bionic
dependencies:
......@@ -133,14 +133,15 @@ deploy:ubuntu_bionic:
ci:osx:
stage: ci
script:
- source ${CI_PROJECT_DIR}/BuildServer/Unix/definitions_macos.sh
- source ${CI_PROJECT_DIR}/BuildServer/Unix/version.sh
- source ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/definitions.sh
- source ${CI_PROJECT_DIR}/BuildServer/Unix/setup_ci.sh
- ${CI_PROJECT_DIR}/BuildServer/Unix/build.sh
- ${CI_PROJECT_DIR}/BuildServer/Unix/tests.sh
allow_failure: false
artifacts:
paths:
- ${CI_PROJECT_DIR}/BuildServer/Unix/Build_macOS
- ${CI_PROJECT_DIR}/build
- ${CI_PROJECT_DIR}/temp
expire_in: 1 hrs
tags:
- sci
......@@ -149,9 +150,9 @@ ci:osx:
deploy:osx:
stage: deploy
script:
- source ${CI_PROJECT_DIR}/BuildServer/Unix/definitions_macos.sh
- source ${CI_PROJECT_DIR}/BuildServer/Unix/version.sh
- ${CI_PROJECT_DIR}/BuildServer/Unix/deploy_macos.sh
- source ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/definitions.sh
- source ${CI_PROJECT_DIR}/BuildServer/Unix/setup_ci.sh
- ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/deploy.sh
dependencies:
- ci:osx
allow_failure: false
......@@ -178,13 +179,15 @@ ci:windows:
stage: ci
script:
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\definitions.bat"
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\version.bat"
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\setup_ci.bat"
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\build.bat"
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\tests.bat"
allow_failure: false
artifacts:
paths:
- "%CI_PROJECT_DIR%\\BuildServer\\Windows\\Build"
- "%CI_PROJECT_DIR%\\build"
- "%CI_PROJECT_DIR%\\Extensions"
expire_in: 1 hrs
tags:
- sci
......@@ -194,7 +197,7 @@ deploy:windows:
stage: deploy
script:
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\definitions.bat"
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\version.bat"
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\setup_ci.bat"
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\deploy.bat"
dependencies:
- ci:windows
......@@ -214,35 +217,13 @@ deploy:windows:
- sci
- windows-10
clean:docker:
stage: clean
docker_logout:
stage: docker_logout
when: always
script:
- chmod 755 ${CI_PROJECT_DIR}/BuildServer/Docker/clean.sh
- ${CI_PROJECT_DIR}/BuildServer/Docker/clean.sh
after_script:
- docker logout
tags:
- docker
- sci
- ubuntu
clean:osx:
stage: clean
when: always
script:
- source ${CI_PROJECT_DIR}/BuildServer/Unix/definitions_macos.sh
- ${CI_PROJECT_DIR}/BuildServer/Unix/clean.sh
tags:
- sci
- osx-10.13
clean:windows:
stage: clean
when: always
script:
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\definitions.bat"
- call "%CI_PROJECT_DIR%\\BuildServer\\Windows\\clean.bat"
tags:
- sci
- windows-10
......@@ -4,15 +4,13 @@ SHELL ["/bin/bash", "-c"]
ARG MDANSE_GIT_COMMIT
ARG MDANSE_GIT_BRANCH_NAME
RUN GIT_SSL_NO_VERIFY=true git clone https://code.ill.fr/scientific-software/mdanse.git
WORKDIR mdanse
RUN git checkout ${MDANSE_GIT_COMMIT}
RUN source ./BuildServer/Unix/definitions_debian.sh ${MDANSE_GIT_BRANCH_NAME}; source ./BuildServer/Unix/version.sh ; ./BuildServer/Unix/build.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/build.sh
RUN source ./BuildServer/Unix/definitions_debian.sh ${MDANSE_GIT_BRANCH_NAME}; source ./BuildServer/Unix/version.sh ; ./BuildServer/Unix/tests.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/tests.sh
......@@ -2,10 +2,8 @@ FROM ci_mdanse_bionic
SHELL ["/bin/bash", "-c"]
ARG MDANSE_GIT_BRANCH_NAME
VOLUME builds
RUN source ./BuildServer/Unix/definitions_debian.sh ${MDANSE_GIT_BRANCH_NAME}; source ./BuildServer/Unix/version.sh ; ./BuildServer/Unix/deploy_debian.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/Debian/deploy.sh
......@@ -4,15 +4,13 @@ SHELL ["/bin/bash", "-c"]
ARG MDANSE_GIT_COMMIT
ARG MDANSE_GIT_BRANCH_NAME
RUN GIT_SSL_NO_VERIFY=true git clone https://code.ill.fr/scientific-software/mdanse.git
WORKDIR mdanse
RUN git checkout ${MDANSE_GIT_COMMIT}
RUN source ./BuildServer/Unix/definitions_debian.sh ${MDANSE_GIT_BRANCH_NAME}; source ./BuildServer/Unix/version.sh ; ./BuildServer/Unix/build.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/build.sh
RUN source ./BuildServer/Unix/definitions_debian.sh ${MDANSE_GIT_BRANCH_NAME}; source ./BuildServer/Unix/version.sh ; ./BuildServer/Unix/tests.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/tests.sh
......@@ -2,10 +2,8 @@ FROM ci_mdanse_trusty
SHELL ["/bin/bash", "-c"]
ARG MDANSE_GIT_BRANCH_NAME
VOLUME builds
RUN source ./BuildServer/Unix/definitions_debian.sh ${MDANSE_GIT_BRANCH_NAME}; source ./BuildServer/Unix/version.sh ; ./BuildServer/Unix/deploy_debian.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/Debian/deploy.sh
......@@ -4,15 +4,13 @@ SHELL ["/bin/bash", "-c"]
ARG MDANSE_GIT_COMMIT
ARG MDANSE_GIT_BRANCH_NAME
RUN GIT_SSL_NO_VERIFY=true git clone https://code.ill.fr/scientific-software/mdanse.git
WORKDIR mdanse
RUN git checkout ${MDANSE_GIT_COMMIT}
RUN source ./BuildServer/Unix/definitions_debian.sh ${MDANSE_GIT_BRANCH_NAME}; source ./BuildServer/Unix/version.sh ; ./BuildServer/Unix/build.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/build.sh
RUN source ./BuildServer/Unix/definitions_debian.sh ${MDANSE_GIT_BRANCH_NAME}; source ./BuildServer/Unix/version.sh ; ./BuildServer/Unix/tests.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/tests.sh
......@@ -2,10 +2,8 @@ FROM ci_mdanse_xenial
SHELL ["/bin/bash", "-c"]
ARG MDANSE_GIT_BRANCH_NAME
VOLUME builds
RUN source ./BuildServer/Unix/definitions_debian.sh ${MDANSE_GIT_BRANCH_NAME}; source ./BuildServer/Unix/version.sh ; ./BuildServer/Unix/deploy_debian.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/Debian/deploy.sh
export ARCH=amd64
export DISTRO=$(lsb_release -c | cut -f2)
export PYTHONEXE=/usr/bin/python
export SED_I_COMMAND=(sed -i)
......@@ -9,58 +9,70 @@ export DISTUTILS_DEBUG=0
#############################
# PREPARATION
#############################
cd ${MDANSE_SOURCE_DIR}
DEBIAN_ROOT_DIR=${MDANSE_SOURCE_DIR}/BuildServer/Build_Debian
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DEBIAN_ROOT_DIR=${CI_TEMP_DIR}/dist
rm -rf ${DEBIAN_ROOT_DIR}
mkdir ${DEBIAN_ROOT_DIR}
mkdir -p ${DEBIAN_ROOT_DIR}
#############################
# PACKAGING
#############################
echo -e "${BLUE}""Build debian tree""${NORMAL}"
# Set automatically the good version number for the Debian control file
sed -i "s/Version:.*/Version: ${VERSION_NAME}/g" BuildServer/Unix/Debian_resources/DEBIAN/control
# Copy all the debian files (e.g. control, copyright, md5sum ...) into DEBIAN directory
cp -r BuildServer/Unix/Debian_resources/DEBIAN ${DEBIAN_ROOT_DIR}/
cp -r ${SCRIPT_DIR}/Resources/DEBIAN ${DEBIAN_ROOT_DIR}/
# Set automatically the good version number for the Debian control file
sed -i "s/Version:.*/Version: ${VERSION_NAME}/g" ${DEBIAN_ROOT_DIR}/DEBIAN/control
chmod -R 755 ${DEBIAN_ROOT_DIR}/DEBIAN
# Build the /usr/share/applications directory inside the debian root directory and copy the mdanse desktop file inside
DEBIAN_APP_DIR=${DEBIAN_ROOT_DIR}/usr/share/applications
mkdir -p ${DEBIAN_APP_DIR}
cp BuildServer/Unix/Debian_resources/MDANSE.desktop ${DEBIAN_APP_DIR}/
cp ${SCRIPT_DIR}/Resources/MDANSE.desktop ${DEBIAN_APP_DIR}/
# Build the /usr/share/pixmaps directory inside the debian root directory and copy the mdanse icon file inside
DEBIAN_PIXMAPS_DIR=${DEBIAN_ROOT_DIR}/usr/share/pixmaps
mkdir -p ${DEBIAN_PIXMAPS_DIR}
cp MDANSE/GUI/Icons/mdanse.png ${DEBIAN_PIXMAPS_DIR}/
cp ${CI_PROJECT_DIR}/MDANSE/GUI/Icons/mdanse.png ${DEBIAN_PIXMAPS_DIR}/
# Build the /usr/local/bin directory inside the debian root directory and copy the mdanse scripts inside
DEBIAN_BIN_DIR=${DEBIAN_ROOT_DIR}/usr/local/bin
mkdir -p ${DEBIAN_BIN_DIR}
cp Scripts/* ${DEBIAN_BIN_DIR}/
cp ${CI_PROJECT_DIR}/Scripts/* ${DEBIAN_BIN_DIR}/
dos2unix ${DEBIAN_BIN_DIR}/mdanse_*
# Build the usr/local/lib/python2.7/dist-packages directory inside the debian root directory and copy the MDANSE package inside
DEBIAN_DIST_DIR=${DEBIAN_ROOT_DIR}/usr/local/lib/python2.7/dist-packages
mkdir -p ${DEBIAN_DIST_DIR}
cd ${CI_PROJECT_DIR}
# 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
# Copy the localy installed ScientificPython, MMTK and MDANSE
cp -r ${MDANSE_TEMPORARY_INSTALLATION_DIR}/lib/python2.7/site-packages/Scientific ${DEBIAN_DIST_DIR}
cp -r ${MDANSE_TEMPORARY_INSTALLATION_DIR}/lib/python2.7/site-packages/MMTK ${DEBIAN_DIST_DIR}
cp -r ${MDANSE_TEMPORARY_INSTALLATION_DIR}/lib/python2.7/site-packages/MDANSE ${DEBIAN_DIST_DIR}
cp -r ${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages/Scientific ${DEBIAN_DIST_DIR}
cp -r ${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages/MMTK ${DEBIAN_DIST_DIR}
cp -r ${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages/MDANSE ${DEBIAN_DIST_DIR}
# Compute the Installed-Size field for the debian package
instSize=$(du ${DEBIAN_ROOT_DIR} -b -s | cut -f1)
sed -i "s/Installed-Size:.*/Installed-Size: $((1+(instSize/1024)))/g" ${DEBIAN_ROOT_DIR}/DEBIAN/control
export TMPDIR=.
fakeroot dpkg-deb -b ${DEBIAN_ROOT_DIR} ${MDANSE_SOURCE_DIR}/MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.deb
fakeroot dpkg-deb -b ${DEBIAN_ROOT_DIR} ${CI_PROJECT_DIR}/MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.deb
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}" "Cannot build app.""${NORMAL}"
exit $status
fi
rm -rf ${MDANSE_TEMPORARY_INSTALLATION_DIR}
\ No newline at end of file
......@@ -6,8 +6,9 @@ if sys.platform.startswith('darwin'):
from setuptools import setup
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 = {
u'CFBundleName': u'MDANSE',
......@@ -17,14 +18,14 @@ if sys.platform.startswith('darwin'):
u'LSApplicationCategoryType': u'public.app-category.science'
}
OPTIONS = {
'argv_emulation': False,# has to be False otherwise triggers problems zith wxPython which lose some events that are captured by OS
'iconfile': u'../../MDANSE/GUI/Icons/mdanse.icns',
'argv_emulation': False,# has to be False otherwise triggers problems with wxPython which lose some events that are captured by OS
'iconfile': os.path.join(project_dir,'MDANSE','GUI','Icons','mdanse.icns'),
'excludes': 'PyQt4',
'matplotlib_backends': '-',
'optimize': '1',
'plist': PLIST,
'bdist_base': './Build_macOS/build',
'dist_dir': './Build_macOS/dist',
'bdist_base': os.environ['CI_TEMP_BUILD_DIR'],
'dist_dir': os.path.join(os.environ['CI_TEMP_DIR'],'dist'),
'graph': False,
'xref': False,
'packages' : ["MDANSE","MMTK","Scientific"]
......
#!/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"
......
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 "")
#!/bin/bash
#############################
# 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}
cd ${CI_PROJECT_DIR}
#############################
# BUILDING DEPENDENCIES
#############################
# Build ILL version of ScientificPython
echo -e "${BLUE}""Building ScientificPython""${NORMAL}"
cd /tmp
rm -rf scientific-python
git clone https://code.ill.fr/scientific-software/scientific-python.git
cd scientific-python
git checkout master
${PYTHONEXE} setup.py build
status=$?
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}
${PYTHONEXE} setup.py install --prefix=${CI_TEMP_INSTALL_DIR}
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to install Scientific""${NORMAL}"
echo -e "${RED}" "Failed to build/install Scientific""${NORMAL}"
exit $status
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
echo -e "${BLUE}""Building MMTK""${NORMAL}"
cd /tmp
rm -rf mmtk
git clone https://code.ill.fr/scientific-software/mmtk.git
cd mmtk
git checkout master
${PYTHONEXE} setup.py build
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to build MMTK""${NORMAL}"
exit $status
fi
${PYTHONEXE} setup.py install --prefix=${MDANSE_TEMPORARY_INSTALLATION_DIR}
# Env var needed by MMTK
export NETCDF_HEADER_FILE_PATH=${CI_TEMP_INSTALL_DIR}/include/python2.7/
${PYTHONEXE} setup.py install --prefix=${CI_TEMP_INSTALL_DIR}
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to install MMTK""${NORMAL}"
echo -e "${RED}" "Failed to build/install MMTK""${NORMAL}"
exit $status
fi
......@@ -58,20 +44,15 @@ fi
# MDANSE Building
#############################
echo -e "${BLUE}""Building MDANSE""${NORMAL}"
cd $MDANSE_SOURCE_DIR
cd ${CI_PROJECT_DIR}
# Now build last version and install it
${PYTHONEXE} setup.py build
${PYTHONEXE} setup.py install --prefix=${CI_TEMP_INSTALL_DIR}
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}" "Failed to build MDANSE""${NORMAL}"
exit $status
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 @@
#############################
# PREPARATION
#############################
cd ${MDANSE_SOURCE_DIR}
export PYTHONPATH=${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages:${PYTHONPATH}
#############################
# UNITARY TESTS
#############################
echo -e "${BLUE}""Performing unitary tests""${NORMAL}"
cd Tests/UnitTests
cd ${CI_PROJECT_DIR}/Tests/UnitTests
${PYTHONEXE} AllTests.py
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}" "One or several unit tests failed"
exit $status
fi
cd ${MDANSE_SOURCE_DIR}
#############################
# DEPENDENCIES TESTS
#############################
echo -e "${BLUE}""Performing dependencies tests""${NORMAL}"
cd Tests/DependenciesTests
cd ${CI_PROJECT_DIR}/Tests/DependenciesTests
${PYTHONEXE} AllTests.py
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}" "One or several dependencies tests failed"
exit $status
fi
cd ${MDANSE_SOURCE_DIR}
#############################
# FUCNTIONAL TESTS
#############################
echo -e "${BLUE}""Performing functional tests""${NORMAL}"
cd Tests/FunctionalTests/Jobs
cd ${CI_PROJECT_DIR}/Tests/FunctionalTests/Jobs
rm -rf Test_*
${PYTHONEXE} BuildJobTests.py
${PYTHONEXE} AllTests.py
......@@ -44,4 +43,4 @@ if [ $status -ne 0 ]; then
echo -e "${RED}" "One or several functional tests failed"
exit $status
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