[squash] split common data
instead of building the packaged binaries with the `bindata` tag, this introduces a new forgejo-common package which contains common assets and architecture independent files. This is the first of a handful of PRs that will ultimately enable building packages for multiple architectures.
This commit is contained in:
parent
7fcc7721f8
commit
b5914277d3
11 changed files with 54 additions and 25 deletions
37
.ci-make.sh
37
.ci-make.sh
|
@ -8,6 +8,10 @@ CI_VERIFY_RETRY_COUNT=30 # How many times to retry before giving up if the pipel
|
|||
case "$1" in
|
||||
"submodule-build")
|
||||
cd "$2"
|
||||
LDFLAGS="$LDFLAGS -X \"code.gitea.io/gitea/modules/setting.StaticRootPath=/usr/share/forgejo\""
|
||||
LDFLAGS="$LDFLAGS -X \"code.gitea.io/gitea/modules/setting.AppWorkPath=/var/lib/forgejo\""
|
||||
LDFLAGS="$LDFLAGS -X \"code.gitea.io/gitea/modules/setting.CustomConf=/etc/forgejo/app.ini\""
|
||||
export LDFLAGS
|
||||
make build
|
||||
EXIT_STATUS=$?
|
||||
mv gitea ../"$3"
|
||||
|
@ -145,11 +149,14 @@ case "$1" in
|
|||
mkdir deb/forgejo-sqlite-bin
|
||||
mv forgejo-bin deb/forgejo-bin/forgejo
|
||||
mv forgejo-sqlite-bin deb/forgejo-sqlite-bin/forgejo
|
||||
cp -r forgejo/public deb/public
|
||||
cp -r forgejo/templates deb/templates
|
||||
cp -r forgejo/options deb/options
|
||||
if [ -x forgejo-bin-dl ] ; then
|
||||
mkdir deb/forgejo-bin-dl
|
||||
mv forgejo-bin-dl deb/forgejo-bin-dl/forgejo
|
||||
mv deb/.forgejo-bin.install deb/debian/forgejo-bin.install
|
||||
ln -s forgejo.preinst deb/debian/forgejo-bin.preinst
|
||||
ln -s forgejo-common.preinst deb/debian/forgejo-bin.preinst
|
||||
ln -s forgejo.postinst deb/debian/forgejo-bin.postinst
|
||||
ln -s forgejo.prerm deb/debian/forgejo-bin.prerm
|
||||
echo >> deb/debian/control
|
||||
|
@ -192,13 +199,27 @@ case "$1" in
|
|||
"install-run-test")
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt update
|
||||
apt install -y ./"$2"
|
||||
[ -f "/etc/default/forgejo" ] && . /etc/default/forgejo
|
||||
[ -z "$FORGEJO_HOME" ] && FORGEJO_HOME=/var/lib/forgejo
|
||||
[ -z "$FORGEJO_USER" ] && FORGEJO_USER=forgejo
|
||||
sudo -u $FORGEJO_USER USER=$FORGEJO_USER \
|
||||
HOME=$FORGEJO_HOME FORGEJO_WORK_DIR=$FORGEJO_HOME \
|
||||
forgejo web -q --config /etc/forgejo/app.ini &
|
||||
if [ "$2" = "${2#"./forgejo-bin_"}" ] ; then
|
||||
APT_FORGEJO_COMMON_RESOLVE="$(ls -1 ./forgejo-common_*_all.deb)"
|
||||
if [ -f "$APT_FORGEJO_COMMON_RESOLVE" ] ; then
|
||||
APT_FORGEJO_COMMON="./$APT_FORGEJO_COMMON_RESOLVE"
|
||||
else
|
||||
echo "ERR! Unable to find the necessary forgejo-common package!"
|
||||
exit 96
|
||||
fi
|
||||
fi
|
||||
apt install -y $APT_FORGEJO_COMMON ./"$2"
|
||||
if [ -f "/etc/default/forgejo" ] || [ "$2" != "${2#"./forgejo-bin_"}" ] ; then
|
||||
[ -f "/etc/default/forgejo" ] && . /etc/default/forgejo
|
||||
[ -z "$FORGEJO_HOME" ] && FORGEJO_HOME=/var/lib/forgejo
|
||||
[ -z "$FORGEJO_USER" ] && FORGEJO_USER=forgejo
|
||||
sudo -u $FORGEJO_USER USER=$FORGEJO_USER \
|
||||
HOME=$FORGEJO_HOME FORGEJO_WORK_DIR=$FORGEJO_HOME \
|
||||
forgejo web -q --config /etc/forgejo/app.ini &
|
||||
else
|
||||
echo "No env setup! Run testing defaults using hardcoded vars..."
|
||||
sudo -u forgejo USER=forgejo forgejo web -q &
|
||||
fi
|
||||
sleep 10
|
||||
curl http://localhost:3000/ | grep -A 4 "Powered by Forgejo"
|
||||
exit $?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue