67 lines
1.6 KiB
Bash
Executable File
67 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
git submodule foreach git fetch
|
|
git submodule foreach git reset --hard origin/${BRANCH_NAME}
|
|
|
|
# Remove current vendor-dir
|
|
echo "-- Cleanup existing vendor/output directories"
|
|
rm -rf vendor
|
|
rm -f composer.lock
|
|
rm -rf build
|
|
|
|
# run composer/npm and grunt for dist
|
|
if [ -e composer.json ]; then
|
|
echo "-- Do composer install:"
|
|
composer install --no-dev
|
|
fi
|
|
if [ -e package.json ]; then
|
|
echo "-- Do npm install:"
|
|
npm install
|
|
fi
|
|
if [ -e Gruntfile.js ]; then
|
|
echo "-- Do grunt dist:"
|
|
./node_modules/.bin/grunt dist
|
|
fi
|
|
|
|
echo "-- Generate translations"
|
|
find webroot -name language.sh | while read langsh; do
|
|
chmod a+x $langsh
|
|
pushd `dirname $langsh`
|
|
./`basename $langsh`
|
|
popd
|
|
done
|
|
|
|
# Create CMakeLists
|
|
REPONAME=legacy-mtinfo
|
|
sed -e "s/@REPONAME@/${REPONAME}/g" CMakeLists.txt.template > CMakeLists.txt
|
|
|
|
# Run cmake
|
|
mkdir -p build
|
|
cd build
|
|
cmake ..
|
|
|
|
make package
|
|
cd ..
|
|
|
|
##
|
|
# Create folders based on branch for publishing debian packages using git-flow
|
|
# The master branch is linked to the debian testing repository
|
|
# The develop branch is linked to the debian development repository
|
|
# build/dist/{development,master,acceptation,production}
|
|
##
|
|
[[ "${component}" == "master" ]] && component="testing";
|
|
[[ "${component}" == "develop" ]] && component="development";
|
|
|
|
DIST_PATH="./build/dist"
|
|
component="${BRANCH_NAME}"
|
|
|
|
if [[ "${component}" == "development" || "${component}" == "testing" || "${component}" == "acceptation" || "${component}" == "production" ]]; then
|
|
echo "Creating dist package for component: '${component}'"
|
|
mkdir -p ${DIST_PATH}/${component}
|
|
cp build/*.deb ${DIST_PATH}/${component}/
|
|
else
|
|
echo "NO dist package for component: '${component}'"
|
|
fi
|