Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
6ce1816c
Commit
6ce1816c
authored
Aug 26, 2016
by
eric pellegrini
Browse files
Splitted the debian build server script into separate stages scripts
parent
964a9b3d
Changes
3
Hide whitespace changes
Inline
Side-by-side
BuildServer/Debian/run_build.sh
0 → 100755
View file @
6ce1816c
#!/bin/bash
export
ARCH
=
$1
export
DISTRO
=
$2
#############################
# CONFIGURATION
#############################
## Add some colors
VERT
=
"
\\
033[1;32m"
NORMAL
=
"
\\
033[0;39m"
ROUGE
=
"
\\
033[1;31m"
ROSE
=
"
\\
033[1;35m"
BLEU
=
"
\\
033[1;34m"
BLANC
=
"
\\
033[0;02m"
BLANCLAIR
=
"
\\
033[1;08m"
JAUNE
=
"
\\
033[1;33m"
CYAN
=
"
\\
033[1;36m"
if
[
-n
"
${
RUN_NIGHTLY_BUILD
}
"
]
then
VERSION_NAME
=
"devel"
else
if
[[
$CI_BUILD_TAG
=
~ ^v
([
0-9]+
\.
[
0-9]+
\.
[
0-9]+
)
$
]]
;
then
VERSION_NAME
=
${
BASH_REMATCH
[1]
}
else
echo
-e
"
$ROUGE
""Invalid version number
${
CI_BUILD_TAG
}
"
"
$NORMAL
"
exit
fi
fi
##Select the build target
BUILD_TARGET
=
debian
cd
cd
$CI_PROJECT_DIR
# Get revision number from git (without trailing newline)
REV_NUMBER
=
$(
git rev-list
--count
HEAD
)
echo
-e
"
$BLEU
""Revision number =
${
REV_NUMBER
}
<--"
"
$NORMAL
"
# Add current revision number to python source code (will appear in "About..." dialog)
# see http://stackoverflow.com/questions/7648328/getting-sed-error
sed
-i
"s/.*__version__.*/__version__ =
\"
${
VERSION_NAME
}
\"
/"
MDANSE/__pkginfo__.py
sed
-i
"s/.*__revision__.*/__revision__ =
\"
${
REV_NUMBER
}
\"
/"
MDANSE/__pkginfo__.py
sed
-i
"s/.*__date__.*/__date__ =
\"
`
date
+
"%d-%m-%Y"
`
\"
/"
MDANSE/__pkginfo__.py
# Now build last version
echo
"
$BLEU
""Building MDANSE"
"
$NORMAL
"
python setup.py build
BuildServer/Debian/run_deploy.sh
0 → 100755
View file @
6ce1816c
#!/bin/bash
export
ARCH
=
$1
export
DISTRO
=
$2
#############################
# CONFIGURATION
#############################
## Add some colors
ROUGE
=
"
\\
033[1;31m"
BLEU
=
"
\\
033[1;34m"
if
[
-n
"
${
RUN_NIGHTLY_BUILD
}
"
]
then
VERSION_NAME
=
"devel"
else
if
[[
$CI_BUILD_TAG
=
~ ^v
([
0-9]+
\.
[
0-9]+
\.
[
0-9]+
)
$
]]
;
then
VERSION_NAME
=
${
BASH_REMATCH
[1]
}
else
echo
-e
"
$ROUGE
""Invalid version number
${
CI_BUILD_TAG
}
"
"
$NORMAL
"
exit
fi
fi
##Select the build target
BUILD_TARGET
=
debian
cd
cd
$CI_PROJECT_DIR
echo
"
$BLEU
""Build debian tree"
"
$NORMAL
"
# Set automatically the good version number for the Debian control file
sed
-i
"s/Version:.*/Version:
${
VERSION_NAME
}
/g"
BuildServer/Debian/DEBIAN/control
DEBIAN_ROOT_DIR
=
BuildServer/Debian/Build
# Copy all the debian files (e.g. control, copyright, md5sum ...) into DEBIAN directory
mkdir
${
DEBIAN_ROOT_DIR
}
cp
-r
BuildServer/Debian/DEBIAN
${
DEBIAN_ROOT_DIR
}
/
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/Debian/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
}
/
# 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
build/scripts-2.7/
*
${
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
}
cp
-r
build/lib.linux-x86_64-2.7/MDANSE
${
DEBIAN_DIST_DIR
}
# also copy the localy installed ScientificPython and MMTK
cp
-r
/usr/local/lib/python2.7/dist-packages/Scientific
*
${
DEBIAN_DIST_DIR
}
cp
-r
/usr/local/lib/python2.7/dist-packages/MMTK
*
${
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
}
${
DEBIAN_ROOT_DIR
}
/MDANSE-
${
VERSION_NAME
}
-
${
DISTRO
}
-
${
ARCH
}
.deb
BuildServer/Debian/run_tests.sh
0 → 100755
View file @
6ce1816c
#!/bin/bash
cd
$CI_PROJECT_DIR
# Performs the unit tests
cd
Tests/UnitTests
nosetests
--verbosity
=
3
-P
.
cd
../..
# Performs the functional tests
cd
Tests/FunctionalTests/Jobs
python BuildJobTests.py
nosetests
--verbosity
=
3
--exe
-P
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment