Update gitea and remove rust (fake)
This commit is contained in:
parent
5cdb3e5c40
commit
e06e93736a
7 changed files with 30 additions and 81 deletions
|
@ -1,40 +1,38 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
[ -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 $ROOTFS.raw ] && 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 systemctl stop gitea.service && sudo portablectl detach gitea) || echo "Image not attached."
|
||||
|
||||
sudo mkdir -p $ROOTFS
|
||||
sudo tar xf $ALPINE_TARBALL -C $ROOTFS/
|
||||
mkdir -p $ROOTFS
|
||||
tar xf $ALPINE_TARBALL -C $ROOTFS/
|
||||
|
||||
sudo mkdir -p \
|
||||
chmod 755 $ROOTFS
|
||||
|
||||
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/run/gitea \
|
||||
$ROOTFS/root/.ssh
|
||||
|
||||
sudo touch $ROOTFS/etc/machine-id $ROOTFS/etc/resolv.conf
|
||||
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 systemd-nspawn --directory $ROOTFS/ /bin/rm -rf /etc/apk/* /var/cache/*
|
||||
|
||||
sudo cp systemd/* $ROOTFS/etc/systemd/system/
|
||||
cp systemd/* $ROOTFS/etc/systemd/system/
|
||||
|
||||
sudo mksquashfs $ROOTFS/ $ROOTFS.raw -all-root -noappend
|
||||
#sudo rm -rf $ROOTFS
|
||||
rm -f $ROOTFS.raw
|
||||
mksquashfs $ROOTFS/ $ROOTFS.raw -all-root -noappend
|
||||
sudo portablectl attach $ROOTFS.raw
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
[Unit]
|
||||
Description=Gitea (Git with a cup of tea)
|
||||
After=network.target
|
||||
#Requires=sshd.socket
|
||||
|
||||
#Requires=mysql.service
|
||||
#Requires=mariadb.service
|
||||
#Requires=postgresql.service
|
||||
|
@ -8,17 +10,13 @@ After=network.target
|
|||
#Requires=redis.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=gitea
|
||||
User=git
|
||||
Group=www-data
|
||||
|
||||
Environment=USER=gitea HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea
|
||||
WorkingDirectory=/var/lib/gitea
|
||||
Environment=USER=git HOME=/var/lib/gitea GITEA_WORK_DIR=/var/lib/gitea
|
||||
|
||||
ExecStart=/bin/ls -al /etc/gitea/
|
||||
#ExecStart=/usr/bin/gitea web -c /etc/gitea/app.ini
|
||||
ExecStart=/usr/bin/gitea web -c /etc/gitea/app.ini
|
||||
|
||||
RuntimeDirectory=gitea
|
||||
StateDirectory=gitea
|
||||
ConfigurationDirectory=gitea
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ mkdir -p \
|
|||
|
||||
touch $ROOTFS/etc/machine-id $ROOTFS/etc/resolv.conf
|
||||
|
||||
touch $ROOTFS/etc/machine-id $ROOTFS/etc/resolv.conf
|
||||
cp systemd/* $ROOTFS/etc/systemd/system/
|
||||
|
||||
sudo systemd-nspawn --bind=$PWD/scripts/install.sh:/root/install.sh -D $ROOTFS/ /bin/sh /root/install.sh
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
ROOTFS=/tmp/cgit
|
||||
ALPINE_TARBALL=alpine-minirootfs-3.9.2-x86_64.tar.gz
|
||||
|
||||
# wget http://dl-cdn.alpinelinux.org/alpine/v3.9/releases/x86_64/$ALPINE_TARBALL
|
||||
|
||||
mkdir -p $ROOTFS
|
||||
tar xf $ALPINE_TARBALL -C $ROOTFS/ \
|
||||
./etc/apk ./etc/os-release ./usr ./lib ./bin ./sbin ./var
|
||||
|
||||
mkdir -p $ROOTFS/etc/systemd/system \
|
||||
$ROOTFS/var/{lib,run,tmp} \
|
||||
$ROOTFS/{dev,tmp,proc,root,run,sys} \
|
||||
$ROOTFS/etc/git \
|
||||
$ROOTFS/var/lib/git
|
||||
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 cgit uwsgi-cgi
|
||||
cp systemd/* $ROOTFS/etc/systemd/system/
|
||||
|
||||
mksquashfs $ROOTFS/ $ROOTFS.raw
|
|
@ -1,12 +0,0 @@
|
|||
[Unit]
|
||||
Description=cgit uwsgi service
|
||||
After=network.target
|
||||
Before=nginx.service
|
||||
Requires=cgit.socket
|
||||
|
||||
[Service]
|
||||
DynamicUser=yes
|
||||
User=git
|
||||
Group=git
|
||||
RuntimeDirectory=git
|
||||
ConfigurationDirectory=git
|
|
@ -1,10 +0,0 @@
|
|||
[Unit]
|
||||
Description=cgit socket
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/git/cgit.sock
|
||||
SocketMode=0660
|
||||
SocketGroup=http
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
|
@ -2,23 +2,26 @@
|
|||
|
||||
ROOTFS=`mktemp -d rootfs.XXX -t`
|
||||
TMPDIR=/tmp
|
||||
TARBALL=alpine-minirootfs-3.9.0-x86_64.tar.gz
|
||||
URL=http://dl-cdn.alpinelinux.org/alpine/v3.9/releases/x86_64/$TARBALL
|
||||
TARBALL=alpine-minirootfs-3.10.1-x86_64.tar.gz
|
||||
URL=http://dl-cdn.alpinelinux.org/alpine/v3.10/releases/x86_64/$TARBALL
|
||||
|
||||
# 6. undo
|
||||
sudo systemctl stop simple-test
|
||||
sudo portablectl detach $TMPDIR/simple.raw
|
||||
|
||||
[ "$URL" ] && wget -c $URL
|
||||
|
||||
mkdir $ROOTFS
|
||||
|
||||
# 1. create rootfs
|
||||
tar xf $TARBALL -C $ROOTFS/ \
|
||||
./etc/os-release ./usr ./lib ./bin ./sbin
|
||||
|
||||
# 2. create mount points
|
||||
mkdir -p $ROOTFS/etc/systemd/system $ROOTFS/var/{lib,run,tmp} $ROOTFS/{dev,proc,sys,tmp,run,root}
|
||||
chmod 755 $ROOTFS
|
||||
mkdir -p $ROOTFS/etc/systemd/system $ROOTFS/{proc,sys,dev,run,tmp,var/tmp}
|
||||
touch $ROOTFS/etc/machine-id $ROOTFS/etc/resolv.conf
|
||||
|
||||
# 3. simple service unit
|
||||
cat <<EOF > $ROOTFS/etc/systemd/system/simple.service
|
||||
cat <<EOF > $ROOTFS/etc/systemd/system/simple-test.service
|
||||
[Unit]
|
||||
Description=Simple portable test service
|
||||
|
||||
|
@ -33,7 +36,3 @@ mksquashfs $ROOTFS $TMPDIR/simple.raw -all-root -noappend
|
|||
# 5. attach and start the service
|
||||
sudo portablectl attach $TMPDIR/simple.raw
|
||||
sudo systemctl start simple-test
|
||||
|
||||
# 6. undo
|
||||
#sudo systemctl stop simple-test
|
||||
#sudo portablectl detach $TMPDIR/simple.raw
|
||||
|
|
Loading…
Add table
Reference in a new issue