Commit 9f36c1ad authored by eric pellegrini's avatar eric pellegrini

Fix bug when running setup_ci script

parent b0717b39
......@@ -56,3 +56,28 @@ if [ $status -ne 0 ]; then
exit $status
fi
PKG_INFO=${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages/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
......@@ -12,8 +12,6 @@ export CI_TEMP_INSTALL_DIR=${CI_PROJECT_DIR}/temp/install
export PYTHONPATH=${CI_TEMP_INSTALL_DIR}/lib/python2.7/site-packages:${PYTHONPATH}
rm -rf ${CI_TEMP_DIR}
mkdir -p ${CI_TEMP_DIR}
cd ${CI_PROJECT_DIR}
......@@ -35,28 +33,6 @@ export RED="\\033[1;31m"
export BLUE="\\033[1;34m"
export NORMAL="\\033[0m"
# Update the __pkginfo__ file with the current commit
echo -e "${BLUE}""Commit id = ${CI_COMMIT_ID}""${NORMAL}"
echo -e "${BLUE}""Branch name = ${CI_COMMIT_REF_NAME}""${NORMAL}"
$SED_I_COMMAND "s/.*__commit__.*/__commit__ = \"${CI_COMMIT_ID}\"/" ${CI_PROJECT_DIR}/MDANSE/__pkginfo__.py
# Get MDANSE version
MDANSE_VERSION=`sed -n 's/__version__.*=.*\"\(.*\)\"/\1/p' ${CI_PROJECT_DIR}/MDANSE/__pkginfo__.py`
# Check if branch is master
if [[ ${CI_COMMIT_REF_NAME} == "master" ]]
then
VERSION_NAME=${MDANSE_VERSION}
${SED_I_COMMAND} "s/.*__beta__.*/__beta__ = None/" ${CI_PROJECT_DIR}/MDANSE/__pkginfo__.py
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\"/" ${CI_PROJECT_DIR}/MDANSE/__pkginfo__.py
else
VERSION_NAME=${MDANSE_VERSION}-beta-${CI_COMMIT_ID}
${SED_I_COMMAND} "s/.*__beta__.*/__beta__ = \"beta\"/" ${CI_PROJECT_DIR}/MDANSE/__pkginfo__.py
fi
fi
export VERSION_NAME
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment