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

# RUN FROM c:\cygwin64\bin\bash c:\Users\Administrateur\Desktop\BUILD\package.sh

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

if [ ! $1 ]; then
    BUILD_TARGET="win-amd64"
else
    BUILD_TARGET=$1
fi

15 16 17 18
# Update the __pkginfo__ file with the current commit 
COMMIT_ID=$(git rev-parse --long HEAD)
sed -i 's/.*__commit__.*/__commit__ = \"${COMMIT_ID}\"/' MDANSE/__pkginfo__.py

19
VERSION_NAME=`sed -n 's/__version__.*=.*\"\(.*\)\"/\1/p' MDANSE/__pkginfo__.py`
eric pellegrini's avatar
eric pellegrini committed
20 21

if [[ ${CI_BUILD_REF_NAME} =~ develop ]]
22
then
eric pellegrini's avatar
eric pellegrini committed
23 24 25 26
    if [ -n "${WEEKLY_BUILD}" ]
    then
        VERSION_NAME=${VERSION_NAME}-"weekly-"`date +%Y-%m-%d`
    fi
27
    VERSION_NAME=${VERSION_NAME}-`git rev-parse --short HEAD`
28 29
fi

eric pellegrini's avatar
eric pellegrini committed
30 31


32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
##Which versions of external programs to use
PYTHON_VERSION=2.7.6

CI_PROJECT_DIR_WIN=$(cygpath -a -w ${CI_PROJECT_DIR})

# Change working directory to the directory the script is in
# http://stackoverflow.com/a/246128
SCRIPT_DIR="${CI_PROJECT_DIR}/BuildServer/Windows"

# This is the directory that will contain the temporary installation
TARGET_DIR="${CI_PROJECT_DIR_WIN}\\BuildServer\\Windows\\Build"
TARGET_DIR_CYGWIN=$(cygpath -u $TARGET_DIR)

cd ${SCRIPT_DIR}

echo "Packaging"

# create the MDANSE installer
echo "Creating nsis installer for target ${BUILD_TARGET}..."

makensis /V4 /ONSISlog.txt /DVERSION=${VERSION_NAME} /DARCH=${BUILD_TARGET} /DTARGET_DIR="${TARGET_DIR}" MDANSE_installer.nsi