This commit is contained in:
Vladan Popovic 2019-07-09 18:30:30 +02:00
parent 9b716baf78
commit 5cdb3e5c40
14 changed files with 341 additions and 6 deletions

32
alpine/gitea/app.ini Normal file
View file

@ -0,0 +1,32 @@
RUN_USER = gitea
RUN_MODE = prod
[repository]
ROOT = /var/lib/gitea/git
SCRIPT_TYPE = sh
[server]
STATIC_ROOT_PATH = /usr/share/webapps/gitea
APP_DATA_PATH = /var/lib/gitea/data
[database]
DB_TYPE = sqlite3
PATH = /var/lib/gitea/db/gitea.db
SSL_MODE = disable
[session]
PROVIDER = file
[log]
MODE = info_console
LEVEL = Info
[Log.error_console]
Mode=console
Stderr=true
Level=Error
[Log.info_console]
Mode=console
Stderr=true
Level=Info

40
alpine/gitea/build.sh Executable file
View file

@ -0,0 +1,40 @@
#!/bin/sh
[ -z $ROOTFS ] && ROOTFS=/tmp/gitea
[ -z $ALPINE_VERSION ] && ALPINE_VERSION=3.10
[ -z $ALPINE_RELEASE ] && ALPINE_RELEASE=0
ALPINE_TARBALL=alpine-minirootfs-$ALPINE_VERSION.$ALPINE_RELEASE-x86_64.tar.gz
[ -f $ROOTFS.raw ] && sudo rm $ROOTFS.raw
[ -f $ALPINE_TARBALL ] || wget http://dl-cdn.alpinelinux.org/alpine/v$ALPINE_VERSION/releases/x86_64/$ALPINE_TARBALL
sudo systemctl stop gitea.service && sudo portablectl detach gitea
sudo mkdir -p $ROOTFS
sudo tar xf $ALPINE_TARBALL -C $ROOTFS/
sudo mkdir -p \
$ROOTFS/etc/systemd/system \
$ROOTFS/var/{lib,run,tmp} \
$ROOTFS/{dev,tmp,proc,root,run,sys} \
$ROOTFS/etc/gitea \
$ROOTFS/var/lib/gitea \
$ROOTFS/dev/log \
$ROOTFS/run/systemd/journal \
$ROOTFS/run/{dbus,gitea} \
$ROOTFS/{proc,sys,dev} \
$ROOTFS/var/tmp/ \
$ROOTFS/root/.ssh
sudo touch $ROOTFS/etc/machine-id $ROOTFS/etc/resolv.conf
sudo systemd-nspawn --directory $ROOTFS/ /sbin/apk update
sudo systemd-nspawn --directory $ROOTFS/ /sbin/apk add --no-cache gitea openssh-keygen
# sudo systemd-nspawn --directory $ROOTFS/ /bin/rm -rf /etc/apk /root/.cache /root/.config /var/cache/*
sudo cp systemd/* $ROOTFS/etc/systemd/system/
sudo mksquashfs $ROOTFS/ $ROOTFS.raw -all-root -noappend
#sudo rm -rf $ROOTFS
sudo portablectl attach $ROOTFS.raw

View file

@ -0,0 +1,26 @@
[Unit]
Description=Gitea (Git with a cup of tea)
After=network.target
#Requires=mysql.service
#Requires=mariadb.service
#Requires=postgresql.service
#Requires=memcached.service
#Requires=redis.service
[Service]
Type=simple
User=gitea
Group=www-data
Environment=USER=gitea HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea
WorkingDirectory=/var/lib/gitea
ExecStart=/bin/ls -al /etc/gitea/
#ExecStart=/usr/bin/gitea web -c /etc/gitea/app.ini
RuntimeDirectory=gitea
StateDirectory=gitea
ConfigurationDirectory=gitea
[Install]
WantedBy=multi-user.target