Commit 95c622b3 authored by Jerome Flesch's avatar Jerome Flesch

Gitlab-ci: Add script to update Flatpak repository

Signed-off-by: Jerome Flesch's avatarJerome Flesch <jflesch@openpaper.work>
parent fe5475e7
Pipeline #102459 passed with stage
in 38 minutes and 5 seconds
......@@ -10,6 +10,12 @@ check:
- apt-get install -y -q pycodestyle flake8 python3-flake8
- make check
linux_flatpak:
tags:
- flatpak
script:
- ./update_flatpak_repo.sh
windows_exe:
variables:
MSYSTEM: "MINGW32"
......
#!/bin/sh
echo $PWD
git log -1
LOCKDIR=/tmp/build.lock.d
PIDFILE=${LOCKDIR}/pid
branch=$(git rev-parse --abbrev-ref HEAD)
echo "Branch: ${branch}"
if [ "${branch}" != "master" ] && [ "${branch}" != "testing" ] && [ "${branch}" != "develop" ]; then
echo Nothing to do
exit 0
fi
msg() {
echo "#####" "$@" "######"
}
export LANG=C
if ! mkdir ${LOCKDIR} ; then
pid=$(cat ${PIDFILE})
msg "Lock directory present (PID: ${pid})"
if kill -0 ${pid} ; then
msg "PID ${pid} alive"
exit 1
fi
fi
cleanup() {
msg "Cleaning up ${LOCKDIR}"
rm -rf ${LOCKDIR}
}
# possible race condition if the other was stopping
# -> re-mkdir
mkdir -p ${LOCKDIR}
msg "PID: $$ \> ${PIDFILE}"
echo $$ > ${PIDFILE}
mkdir -p ~/flatpak
cd flatpak/
export EXPORT_ARGS="--gpg-sign=E5ACE6FEA7A6DD48"
export REPO=/home/gitlab-runner/flatpak/repo
for arch in x86_64 i386 ; do
msg "=== Architecture: ${arch} ==="
export ARCH_ARGS=--arch=${arch}
msg "Cleaning ..."
if ! make clean ; then
msg "Clean failed"
cleanup
exit 2
fi
if [ -z "${branch}" ]; then
msg "Building ..."
if ! make ; then
msg "Build failed"
cleanup
exit 2
fi
else
msg "Building branch ${branch} ..."
if ! make ${branch}.app ; then
msg "Build failed"
cleanup
exit 2
fi
if ! make upd_repo ; then
msg "Repo update failed"
cleanup
exit 2
fi
fi
msg "Cleaning ..."
if ! make clean ; then
msg "Clean failed"
cleanup
exit 2
fi
done
chmod -R a+rX ${HOME}/flatpak
cleanup
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