Skip to content
Snippets Groups Projects
Commit 25e15a29 authored by Jan-Tarek Butt's avatar Jan-Tarek Butt
Browse files

CI: remove CI build dir

parent e20d3b3e
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
#https://stackoverflow.com/questions/2870992/automatic-exit-from-bash-shell-script-on-error
set -e
GLUON_BRANCH="$1"
GLUON_VERSION="$2"
#check installed debendenciece
if [ -f /etc/debian_version ]; then
echo "Checking for git..."
if ! command -v git > /dev/null 2>&1; then
echo "git is not installed"
exit 1
fi
echo "Detected git..."
echo "Checking for subversion..."
if ! command -v svn > /dev/null; then
echo "subversion is not installed"
exit 1
fi
echo "Detected subversion..."
echo "Checking for python..."
if ! which python > /dev/null; then
echo "python is not installed"
exit 1
fi
echo "Detected python..."
echo "Checking for build-essential..."
if ! dpkg -s build-essential > /dev/null; then
echo "build-essential is not installed"
exit 1
fi
echo "Detected build-essential..."
echo "Checking for gawk..."
if ! dpkg -s gawk > /dev/null; then
echo "gawk is not installed"
exit 1
fi
echo "Detected gawk..."
echo "Checking for unzip..."
if ! dpkg -s unzip > /dev/null; then
echo "unzip is not installed"
exit 1
fi
echo "Detected unzip..."
echo "Checking for libncurses5-dev..."
if ! dpkg -s libncurses5-dev > /dev/null; then
echo "libncurses5-dev is not installed"
exit 1
fi
echo "Detected libncurses5-dev..."
echo "Checking for zlib1g-dev..."
if ! dpkg -s zlib1g-dev > /dev/null; then
echo "zlib1g-dev is not installed"
exit 1
fi
echo "Detected zlib1g-dev..."
echo "Checking for libssl-dev..."
if ! dpkg -s libssl-dev > /dev/null; then
echo "libssl-dev is not installed"
exit 1
fi
echo "Detected libssl-dev..."
echo "Checking for ecdsasign..."
if ! command -v ecdsasign > /dev/null 2>&1; then
echo "ecdsasign is not installed"
exit 1
fi
echo "Detected ecdsasign..."
fi
# Make Folder site
mkdir site
# Move all into site folder
ls -A | grep -v -E '(^|\s)site($|\s)' | xargs -I{} mv {} site/
# Clone Gluon repo
git init .
git remote add origin https://github.com/freifunk-gluon/gluon.git
git pull origin "$GLUON_VERSION"
git checkout "$GLUON_VERSION"
cd site || exit 1
sh prepare.sh patch || exit 1
cd ..
# fetch packages repos and apply patches
make update || exit 1
# detect core count
CPUS=$(grep -c processor /proc/cpuinfo)
while read line; do
if [[ $line == *GluonTarget* ]]; then
# extract arcitecture parameter value
targ=$(echo $line | sed -e 's/^.*GluonTarget//' -e 's/^,//' -e 's/)).*//' -e 's/[,]/-/')
#Build arcitecture images
make -j $((CPUS*2)) GLUON_TARGET="$targ" BROKEN=1 GLUON_BRANCH="$GLUON_BRANCH" || exit 1
fi;
done < "targets/targets.mk"
# create manifest file for autoupdater
make manifest GLUON_BRANCH="$GLUON_BRANCH"
#!/bin/sh
GLUON_BRANCH="$1"
CI_BUILD_REF_NAME="$2"
mkdir -p /var/www/html/nightly/$CI_BUILD_REF_NAME/
rm /var/www/html/nightly/$CI_BUILD_REF_NAME/*
cp output/images/factory/* /var/www/html/nightly/$CI_BUILD_REF_NAME/
cp output/images/sysupgrade/* /var/www/html/nightly/$CI_BUILD_REF_NAME/
ln -s /var/www/html/nightly/$CI_BUILD_REF_NAME/$GLUON_BRANCH.manifest /var/www/html/nightly/$CI_BUILD_REF_NAME/manifest
#!/bin/sh
GLUON_BRANCH="$1"
ECDSA_PRIVAT_KEY="$2"
echo $ECDSA_PRIVAT_KEY > ecdsa.priv
contrib/sign.sh ecdsa.priv output/images/sysupgrade/$GLUON_BRANCH.manifest
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