Commit e6522414 authored by Eric Pellegrini's avatar Eric Pellegrini

Merge branch 'develop' of https://code.ill.fr/scientific-software/mdanse into develop

parents 22c5c3a6 377f0bb2
Pipeline #7059 passed with stages
in 15 minutes and 56 seconds
stages:
- docker_login
- docker_pre_clean
- ci
- deploy
- docker_logout
- docker_post_clean
docker_login:
stage: docker_login
docker_pre_clean:
stage: docker_pre_clean
script:
- docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY}
- ${CI_PROJECT_DIR}/BuildServer/Docker/clean.sh
allow_failure: true
tags:
- docker
- sci
- ubuntu
docker_post_clean:
stage: docker_post_clean
script:
- ${CI_PROJECT_DIR}/BuildServer/Docker/clean.sh
allow_failure: true
when: always
tags:
- docker
- sci
- ubuntu
############################
# ubuntu trusty pipeline
# ubuntu trusty pipeline
############################
ci:ubuntu_trusty:
stage: ci
script:
- 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 .
- docker build --force-rm=true -t ci_mdanse_trusty -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-trusty/Dockerfile_setup .
- docker build --force-rm=true --build-arg CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA} --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --no-cache -t ci_mdanse_trusty_build -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-trusty/Dockerfile_build .
- docker run -iv${PWD}:/artifacts/ ci_mdanse_trusty_build
allow_failure: false
artifacts:
paths:
- ${CI_PROJECT_DIR}/build
- ${CI_PROJECT_DIR}/temp
expire_in: 1 hrs
tags:
- docker
- sci
......@@ -29,9 +48,9 @@ ci:ubuntu_trusty:
deploy:ubuntu_trusty:
stage: deploy
script:
- 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
- docker build --force-rm=true -t ci_mdanse_trusty -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-trusty/Dockerfile_setup .
- docker build --force-rm=true --build-arg CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA} --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --no-cache -t ci_mdanse_trusty_build -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-trusty/Dockerfile_deploy .
- docker run -iv${PWD}:/artifacts/ ci_mdanse_trusty_build
dependencies:
- ci:ubuntu_trusty
allow_failure: false
......@@ -46,20 +65,27 @@ deploy:ubuntu_trusty:
when: on_success
artifacts:
paths:
- ./*.deb
- ${CI_PROJECT_DIR}/*.deb
tags:
- docker
- sci
- ubuntu
############################
# ubuntu xenial pipeline
# ubuntu xenial pipeline
############################
ci:ubuntu_xenial:
stage: ci
script:
- 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 .
- docker build --force-rm=true -t ci_mdanse_xenial -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-xenial/Dockerfile_setup .
- docker build --force-rm=true --build-arg CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA} --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --no-cache -t ci_mdanse_xenial_build -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-xenial/Dockerfile_build .
- docker run -iv${PWD}:/artifacts/ ci_mdanse_xenial_build
allow_failure: false
artifacts:
paths:
- ${CI_PROJECT_DIR}/build
- ${CI_PROJECT_DIR}/temp
expire_in: 1 hrs
tags:
- docker
- sci
......@@ -68,9 +94,9 @@ ci:ubuntu_xenial:
deploy:ubuntu_xenial:
stage: deploy
script:
- 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
- docker build --force-rm=true -t ci_mdanse_xenial -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-xenial/Dockerfile_setup .
- docker build --force-rm=true --build-arg CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA} --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --no-cache -t ci_mdanse_xenial_build -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-xenial/Dockerfile_deploy .
- docker run -iv${PWD}:/artifacts/ ci_mdanse_xenial_build
dependencies:
- ci:ubuntu_xenial
allow_failure: false
......@@ -85,7 +111,7 @@ deploy:ubuntu_xenial:
when: on_success
artifacts:
paths:
- ./*.deb
- ${CI_PROJECT_DIR}/*.deb
tags:
- docker
- sci
......@@ -97,8 +123,15 @@ deploy:ubuntu_xenial:
ci:ubuntu_bionic:
stage: ci
script:
- 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 .
- docker build --force-rm=true -t ci_mdanse_bionic -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-bionic/Dockerfile_setup .
- docker build --force-rm=true --build-arg CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA} --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --build-arg CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA} --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --no-cache -t ci_mdanse_bionic_build -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-bionic/Dockerfile_build .
- docker run -iv${PWD}:/artifacts/ ci_mdanse_bionic_build
allow_failure: false
artifacts:
paths:
- ${CI_PROJECT_DIR}/build
- ${CI_PROJECT_DIR}/temp
expire_in: 1 hrs
tags:
- docker
- sci
......@@ -107,9 +140,9 @@ ci:ubuntu_bionic:
deploy:ubuntu_bionic:
stage: deploy
script:
- 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
- docker build --force-rm=true -t ci_mdanse_bionic -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-bionic/Dockerfile_setup .
- docker build --force-rm=true --build-arg CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA} --build-arg CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME} --no-cache -t ci_mdanse_bionic_build -f ${CI_PROJECT_DIR}/BuildServer/Docker/Ubuntu-bionic/Dockerfile_deploy .
- docker run -iv${PWD}:/artifacts/ ci_mdanse_bionic_build
dependencies:
- ci:ubuntu_bionic
allow_failure: false
......@@ -221,14 +254,3 @@ deploy:windows:
tags:
- sci
- windows-10
docker_logout:
stage: docker_logout
when: always
script:
- docker logout
tags:
- docker
- sci
- ubuntu
FROM docker.ill.fr/scientific-software/mdanse:ubuntu-bionic
SHELL ["/bin/bash", "-c"]
ARG MDANSE_GIT_COMMIT
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/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/build.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/tests.sh
FROM ci_mdanse_bionic
SHELL ["/bin/bash", "-c"]
VOLUME builds
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; source ./BuildServer/Unix/bionic_dependencies_modification.sh ; ./BuildServer/Unix/Debian/deploy.sh
FROM docker.ill.fr/scientific-software/mdanse:ubuntu-trusty
SHELL ["/bin/bash", "-c"]
ARG MDANSE_GIT_COMMIT
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/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/build.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/tests.sh
FROM ci_mdanse_trusty
SHELL ["/bin/bash", "-c"]
VOLUME builds
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/Debian/deploy.sh
FROM docker.ill.fr/scientific-software/mdanse:ubuntu-xenial
SHELL ["/bin/bash", "-c"]
ARG MDANSE_GIT_COMMIT
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/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/build.sh
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/tests.sh
FROM ci_mdanse_xenial
SHELL ["/bin/bash", "-c"]
VOLUME builds
RUN source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh ; ./BuildServer/Unix/Debian/deploy.sh
#!/bin/bash
docker build --force-rm -t docker.ill.fr/scientific-software/mdanse:$1 -f $2/Dockerfile .
FROM ci_mdanse_bionic
SHELL ["/bin/bash", "-c"]
ARG CI_COMMIT_SHORT_SHA
ARG CI_COMMIT_REF_NAME
ENV CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA}
ENV CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME}
COPY ./ /app/
WORKDIR /app
CMD source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh; ./BuildServer/Unix/build.sh; ./BuildServer/Unix/tests.sh; cp -a ${CI_PROJECT_DIR}/build /artifacts/; cp -a ${CI_PROJECT_DIR}/temp /artifacts/
\ No newline at end of file
FROM ci_mdanse_bionic
SHELL ["/bin/bash", "-c"]
ARG CI_COMMIT_SHORT_SHA
ARG CI_COMMIT_REF_NAME
ENV CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA}
ENV CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME}
COPY ./ /app/
WORKDIR /app
CMD source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh; source ./BuildServer/Unix/bionic_dependencies_modification.sh; ./BuildServer/Unix/Debian/deploy.sh; cp -a *.deb /artifacts/
\ No newline at end of file
FROM ubuntu:bionic
ENV https_proxy http://proxy.ill.fr:8888
ENV http_proxy http://proxy.ill.fr:8888
RUN export DEBIAN_FRONTEND=noninteractive
RUN apt-get update
......@@ -25,6 +28,4 @@ RUN apt-get install -y --no-install-recommends python-nose
RUN apt-get install -y --no-install-recommends python-sphinx
RUN apt-get install -y --no-install-recommends pyro
RUN apt-get install -y --no-install-recommends lsb-release
RUN apt-get install -y --no-install-recommends lsb-release
\ No newline at end of file
FROM ci_mdanse_trusty
SHELL ["/bin/bash", "-c"]
ARG CI_COMMIT_SHORT_SHA
ARG CI_COMMIT_REF_NAME
ENV CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA}
ENV CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME}
COPY ./ /app/
WORKDIR /app
CMD source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh; ./BuildServer/Unix/build.sh; ./BuildServer/Unix/tests.sh; cp -a ${CI_PROJECT_DIR}/build /artifacts/; cp -a ${CI_PROJECT_DIR}/temp /artifacts/
\ No newline at end of file
FROM ci_mdanse_trusty
SHELL ["/bin/bash", "-c"]
ARG CI_COMMIT_SHORT_SHA
ARG CI_COMMIT_REF_NAME
ENV CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA}
ENV CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME}
COPY ./ /app/
WORKDIR /app
CMD source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh; ./BuildServer/Unix/Debian/deploy.sh; cp -a *.deb /artifacts/
\ No newline at end of file
FROM ubuntu:trusty
ENV https_proxy http://proxy.ill.fr:8888
ENV http_proxy http://proxy.ill.fr:8888
RUN export DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y tzdata
......@@ -23,5 +28,4 @@ RUN apt-get install -y --no-install-recommends python-nose
RUN apt-get install -y --no-install-recommends python-sphinx
RUN apt-get install -y --no-install-recommends pyro
RUN apt-get install -y --no-install-recommends lsb-release
RUN apt-get install -y --no-install-recommends lsb-release
\ No newline at end of file
FROM ci_mdanse_xenial
SHELL ["/bin/bash", "-c"]
ARG CI_COMMIT_SHORT_SHA
ARG CI_COMMIT_REF_NAME
ENV CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA}
ENV CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME}
COPY ./ /app/
WORKDIR /app
CMD source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh; ./BuildServer/Unix/build.sh; ./BuildServer/Unix/tests.sh; cp -a ${CI_PROJECT_DIR}/build /artifacts/; cp -a ${CI_PROJECT_DIR}/temp /artifacts/
\ No newline at end of file
FROM ci_mdanse_xenial
SHELL ["/bin/bash", "-c"]
ARG CI_COMMIT_SHORT_SHA
ARG CI_COMMIT_REF_NAME
ENV CI_COMMIT_SHORT_SHA=${CI_COMMIT_SHORT_SHA}
ENV CI_COMMIT_REF_NAME=${CI_COMMIT_REF_NAME}
COPY ./ /app/
WORKDIR /app
CMD source ./BuildServer/Unix/Debian/definitions.sh; source ./BuildServer/Unix/setup_ci.sh; ./BuildServer/Unix/Debian/deploy.sh; cp -a *.deb /artifacts/
\ No newline at end of file
FROM ubuntu:xenial
ENV https_proxy http://proxy.ill.fr:8888
ENV http_proxy http://proxy.ill.fr:8888
RUN export DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y tzdata
......@@ -23,5 +28,4 @@ RUN apt-get install -y --no-install-recommends python-nose
RUN apt-get install -y --no-install-recommends python-sphinx
RUN apt-get install -y --no-install-recommends pyro
RUN apt-get install -y --no-install-recommends lsb-release
RUN apt-get install -y --no-install-recommends lsb-release
\ No newline at end of file
# Return the docker containers that are exited
exited_containers=`docker ps -q -f "status=exited"`
# If some have been found, remove them
if [ -n "$exited_containers" ]
then
docker rm -f ${exited_containers}
fi
# Return the docker images corresponding to MDANSE
images=`docker images -a --format "{{.Repository}}:{{.Tag}}" | grep _mdanse_`
# If some have been found, remove them
if [ -n "$images" ]
then
docker rmi -f ${images}
fi
# Return the docker images that are in dangling state
images=`docker images -q -f "dangling=true"`
# If some dangling images have been found, remove them
if [ -n "$images" ]
then
docker rmi -f ${images}
fi
SET app_name create-dmg
VERSION create-dmg.cur create-dmg heads/master
NEWDIR build.dir temp %-build -
NEWFILE create-dmg.zip featured %.zip %
COPYTO [build.dir]
INTO create-dmg [create-dmg.cur]/create-dmg
INTO sample [create-dmg.cur]/sample
INTO support [create-dmg.cur]/support
SUBSTVARS [build.dir<alter>]/create-dmg [[]]
ZIP [create-dmg.zip]
INTO [build-files-prefix] [build.dir]
PUT megabox-builds create-dmg.zip
PUT megabox-builds build.log
PUT s3-builds create-dmg.zip
PUT s3-builds build.log
# coding=utf-8
import os
import sys
if sys.platform.startswith('darwin'):
from setuptools import setup
version = os.environ['VERSION_NAME']
project_dir = os.environ['CI_PROJECT_DIR']
APP = [os.path.join(project_dir,'Scripts','mdanse_gui')]
PLIST = {
u'CFBundleName': u'MDANSE',
u'CFBundleShortVersionString': version,
u'CFBundleVersion': version,
u'CFBundleIdentifier': u'eu.ill.MDANSE-'+version,
u'LSApplicationCategoryType': u'public.app-category.science'
}
OPTIONS = {
'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,'Src','GUI','Icons','mdanse.icns'),
'excludes': 'PyQt4',
'matplotlib_backends': '-',
'optimize': '1',
'plist': PLIST,
'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","matplotlib"]
}
setup(
name='MDANSE',
app=APP,
options={'py2app': OPTIONS},
setup_requires=['py2app']
)
else:
print 'No build_app implementation for your system.'
#!/bin/bash
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"
for f in $files
do
chmod 777 $f
for l in $libs
do
install_name_tool -change /usr/local/lib/libwx_$l-3.0.dylib @executable_path/../Frameworks/libwx_$l-3.0.dylib $f
done
done
......@@ -129,7 +129,7 @@ DMG_TEMP_NAME="$DMG_DIR/rw.${DMG_NAME}"
SRC_FOLDER="$(cd "$2" > /dev/null; pwd)"
test -z "$VOLUME_NAME" && VOLUME_NAME="$(basename "$DMG_PATH" .dmg)"
AUX_PATH="$SCRIPT_DIR/support"
AUX_PATH="$SCRIPT_DIR/Resources/dmg/support"
test -d "$AUX_PATH" || {
echo "Cannot find support directory: $AUX_PATH"
......@@ -222,11 +222,7 @@ if [ ! -z "${EULA_RSRC}" -a "${EULA_RSRC}" != "-null-" ]; then
"${AUX_PATH}/dmg-license.py" "${DMG_DIR}/${DMG_NAME}" "${EULA_RSRC}"
fi
if [ ! -z "${NOINTERNET}" -a "${NOINTERNET}" == 1 ]; then
echo "not setting 'internet-enable' on the dmg"
else
hdiutil internet-enable -yes "${DMG_DIR}/${DMG_NAME}"
fi
echo "not setting 'internet-enable' on the dmg because internet-enable no more present on macOS systems"
echo "Disk image done"
exit 0
......@@ -5,6 +5,7 @@
#############################
# Debug option for py2app, if needed
export DISTUTILS_DEBUG=0
export MDANSE_DEPENDENCIES_DIR=/Users/ci/Projects/mdanse/bundle
#############################
# PREPARATION
......@@ -28,66 +29,29 @@ fi
# PACKAGING
#############################
echo -e "${BLUE}""Packaging MDANSE""${NORMAL}"
MDANSE_DMG=MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.dmg
cd ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS
${PYTHONEXE} build.py py2app
status=$?
if [ $status -ne 0 ]; then
echo -e "${RED}" "Cannot build app.""${NORMAL}"
exit $status
fi
# Copy the bundle
mkdir ${CI_TEMP_DIR}/dist
mkdir ${CI_TEMP_DIR}/dist/MDANSE.app
cp -R ${MDANSE_DEPENDENCIES_DIR} ${MDANSE_APP_DIR}/Contents
cp -R ${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages/* ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/
# Add MDANSE version file (should read the version from the bundle with pyobjc, but will figure that out later)
echo "${VERSION_NAME}" > ${MDANSE_APP_DIR}/Contents/Resources/version
#############################
# 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 ...)
### 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
### why we have to modify the python executable appropriately with the following commands
rm ${MDANSE_APP_DIR}/Contents/MacOS/python
mkdir -p ${MDANSE_APP_DIR}/Contents/Resources/bin
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_APP_DIR}/Contents/Resources/lib/python2.7/
cp /System/Library/Frameworks/Python.framework/Versions/2.7/Python ${MDANSE_APP_DIR}/Contents/Resources/lib/libpython2.7.dylib
chmod 777 ${MDANSE_APP_DIR}/Contents/Resources/lib/libpython2.7.dylib
# Copy MDANSE GUI
cp ${CI_PROJECT_DIR}/Scripts/mdanse_gui ${MDANSE_APP_DIR}/Contents/Resources/
install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python @executable_path/../Resources/lib/libpython2.7.dylib ${MDANSE_APP_DIR}/Contents/Resources/bin/python
install_name_tool -id @loader_path/libpython2.7.dylib ${MDANSE_APP_DIR}/Contents/Resources/lib/libpython2.7.dylib
# Modify Info.plist
sed -i "" "s/<MDANSE_VERSION>/${VERSION_NAME}/" ${MDANSE_APP_DIR}/Contents/Info.plist
ln -s ../Resources/bin/python ${MDANSE_APP_DIR}/Contents/MacOS/python
cp ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/site.py ${MDANSE_APP_DIR}/Contents/Resources/.
cp ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/site.py ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/.
chmod 777 ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/change_dylib_path.sh
${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/change_dylib_path.sh
# Comment the 'add_system_python_extras' call that add some System path to the sys.path
"${SED_I_COMMAND[@]}" "s/^add_system_python_extras()$/#add_system_python_extras()/" ${MDANSE_APP_DIR}/Contents/Resources/__boot__.py
#############################
# Cleanup
#############################
# Removing matplotlib/tests ==> 45.2 Mb
rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/matplotlib/tests
# Sample data for matplotlib is useless
rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/matplotlib/mpl-data/sample_data
rm -rf ${MDANSE_APP_DIR}/Contents/Resources/mpl-data/sample_data
# Scipy package is useless
rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/scipy
# ZMQ package is useless
rm -rf ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/zmq
# Relink netcdf
install_name_tool -change /usr/local/opt/netcdf/lib/libnetcdf.15.dylib @executable_path/../Frameworks/libnetcdf.15.dylib ${MDANSE_APP_DIR}/Contents/Resources/lib/python2.7/Scientific/_netcdf.so
#############################
# Create DMG
#############################
MDANSE_DMG=MDANSE-${VERSION_NAME}-${DISTRO}-${ARCH}.dmg
hdiutil unmount /Volumes/MDANSE -force -quiet
sleep 5
${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 ${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/${MDANSE_DMG} ${CI_PROJECT_DIR}
${CI_PROJECT_DIR}/BuildServer/Unix/MacOS/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
This diff is collapsed.
......@@ -17,20 +17,22 @@ 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
## Get revision number from Git
CI_COMMIT_ID=${CI_COMMIT_SHORT_SHA}