Skip to content
Snippets Groups Projects
Commit be3ab582 authored by alexandr.kravchenko's avatar alexandr.kravchenko
Browse files

Merged conflicts on master

parents edfc55c2 6b57bf38
No related branches found
No related tags found
Loading
......@@ -10,4 +10,4 @@ kelvin-node-schedule:
stage: build
tags:
- kelvin-node
script: ~/production/integration/gitlab-CI/build_all_handler.sh cellframe-node && ~/production/integration/reprepro/publish.sh debian.pub.demlabs.net stretch main && ~/production/integration/gitlab-CI/travis_test.sh
script: ~/production/integration/gitlab-CI/build_all_handler.sh cellframe-node
#!/bin/bash
export_variables() {
IFS=$'\n'
for variable in $(cat prod_build/$platform/conf/*); do
[ -z $1 ] && export $(echo "$variable" | sed 's/\"//g') || export -n $(echo $variable | cut -d '=' -f1)
done
}
PLATFORM_CANDIDATES=$2
CHROOT_PREFIX="builder"
CHROOTS_PATH=$1
PLATFORMS=$2
PLATFORMS=""
PKG_FORMAT=$3
SRC_PATH=$4
JOB=$5
cd $SRC_PATH
echo "workdir is $(pwd)"
. prod_build/general/pre-build.sh
export_variables "./prod_build/general/conf/*"
IFS=' '
echo "$PLATFORM_CANDIDATES"
echo $IMPLEMENTED
for platform in $PLATFORM_CANDIDATES; do
[[ $(echo $IMPLEMENTED | grep $platform) != "" ]] && PLATFORMS="$PLATFORMS$platform " || echo "Platform $platform is not implemented in this project yet. Sorry"
done
echo "Platforms are $PLATFORMS"
for platform in $PLATFORMS; do
export_variables
echo "Working with $platform now"
export_variables "./prod_build/$platform/conf/*"
IFS=' '
PKG_TYPE=$(echo $PKG_FORMAT | cut -d ' ' -f1)
#Check if chroots are present
echo $HOST_DISTR_VERSIONS
echo $HOST_ARCH_VERSIONS
[ -e prod_build/$platform/scripts/pre-build.sh ] && prod_build/$platform/scripts/pre-build.sh $CHROOT_PREFIX #For actions not in chroot (version update)
[ -e prod_build/$platform/scripts/pre-build.sh ] && prod_build/$platform/scripts/pre-build.sh $CHROOT_PREFIX || exit $? #For actions before build not in chroot and in chroot (version update, install missing dependencies(under schroot))
for distr in $HOST_DISTR_VERSIONS; do
for arch in $HOST_ARCH_VERSIONS; do
if [ -e $CHROOTS_PATH/$CHROOT_PREFIX-$distr-$arch ]; then
schroot -c $CHROOT_PREFIX-$distr-$arch -- launcher.sh prod_build/$platform/scripts/$JOB.sh "$PKG_TYPE" || errcode=$?
schroot -c $CHROOT_PREFIX-$distr-$arch -- launcher.sh prod_build/$platform/scripts/$JOB.sh $PKG_TYPE || errcode=$?
# echo "schroot stub $PKG_TYPE"
else
echo "chroot $CHROOT_PREFIX-$distr-$arch not found. You should install it first"
fi
done
done
echo "workdir before postinstall is $(pwd)"
[ -e prod_build/$platform/scripts/post-build.sh ] && prod_build/$platform/scripts/post-build.sh #For post-build actions not in chroot (global publish)
PKG_FORMAT=$(echo $PKG_FORMAT | cut -d ' ' -f2-)
# export_variables clean
unexport_variables "./prod_build/$platform/conf/*"
done
#[ $(mount | grep "/run/schroot/mount") ] && sudo umount -l /run/schroot/mount && sudo rm -r /run/schroot/mount/* #Removing mountpoint odds.
......
IMPLEMENTED="linux/debian"
HOST_DISTR_VERSIONS="stretch buster"
HOST_DISTR_VERSIONS="buster"
HOST_ARCH_VERSIONS="amd64"
PACKAGE_PATH=builds/deb/
REPO_DIR_SRC=/var/tmp/repository
DISTR_CODENAME="stretch"
REPO_ADDR=debian.pub.demlabs.net
REPO_DIR=/var/www/html/debian.pub.demlabs.net
DISTR_COMPONENT=main
......@@ -2,17 +2,28 @@
echo "Deploying to $PACKAGE_PATH"
echo $wd
PKGFILES=($(ls build/*.deb))
mv build/*.deb $wd/$PACKAGE_PATH || echo "[ERR] Something went wrong in publishing the package. Now aborting."
if [ ! -z $UPDVER ]; then
cd build
PKGFILES=($(ls *.deb))
cd ..
mv build/*.deb $wd/$PACKAGE_PATH/ || echo "[ERR] Something went wrong in publishing the package. Now aborting."
NOTONBUILDSERVER=0
gitlab-runner -v 2&>> /dev/null || NOTONBUILDSERVER=$?
if [[ $NOTONBUILDSERVER == 0 ]]; then
mkdir -p $REPO_DIR_SRC
for pkgfile in $PKGFILES; do
ln -sf $wd/$PACKAGE_PATH/$pkgfile $wd/$PACKAGE_PATH/$pkgfile-latest
cp -v $wd/$PACKAGE_PATH/$pkgfile $REPO_DIR_SRC
done
export -n "UPDVER"
cd $REPO_DIR
sudo reprepro -C "$DISTR_COMPONENT" --ask-passphrase includedeb "$DISTR_CODENAME" $REPO_DIR_SRC/*.deb
#Update into reprepro:
#Need to create latest symlink to the project.
fi
export -n "UPDVER"
rm -r $REPO_DIR_SRC
cd $wd
#symlink name-actual to the latest version.
#build/deb/versions - for all files
#build/deb/${PROJECT}-latest - for symlinks.
......@@ -93,7 +93,9 @@ extract_version_number
### This is a solution. We modify the changelog only if there are updates and not on build servers. And of course if it's not cmake-based build project.
### let's keep those comments here for a while
if [ $( gitlab-runner -v 2> /dev/null ; echo $? ) == 0 ]; then
NOTONBUILDSERVER=0
gitlab-runner -v 2&>>/dev/null || NOTONBUILDSERVER=$?
if [ $NOTONBUILDSERVER == 0 ]; then
echo "[WRN] on build platform. Version won't be changed" # okay, so this echo wont be outputted as the condition is not true
elif [ ! -e debian/changelog ]; then ### I guess this what's supposed to be added in order to solve the issue with the changelog?+
......@@ -124,8 +126,10 @@ CHROOT_PREFIX=$1
for distr in $HOST_DISTR_VERSIONS; do #we need to install required dependencies under schroot.
for arch in $HOST_ARCH_VERSIONS; do
echo "$CHROOT_PREFIX-$distr-$arch"
schroot -c $CHROOT_PREFIX-$distr-$arch -- prod_build/linux/debian/scripts/chroot/pre-build.sh "$PKG_DEPS"
schroot -c $CHROOT_PREFIX-$distr-$arch -- prod_build/linux/debian/scripts/chroot/pre-build.sh "$PKG_DEPS" || errcode=$?
[[ $errcode != 0 ]] && echo "Problems with $CHROOT_PREFIX-$distr-$arch occured. You had installed it, right?"
done
done
exit 0
## Maybe we do have the version required? Then we don't need to build it again. CHECK IT THERE!
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment