summaryrefslogtreecommitdiffstats
path: root/snap/helpers/simple_launcher.sh
diff options
context:
space:
mode:
authorThorben <tbraeutigam@users.noreply.github.com>2018-05-09 16:52:51 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2018-05-09 22:52:51 +0800
commit14f16d6c2e8db1d99268c44a59aa86132c00eca3 (patch)
treef5d7a1076890bbbe6abdfea6f58b1c0ef3dae0af /snap/helpers/simple_launcher.sh
parent02ecc03d6df8956075d151104e0e07f0d858d578 (diff)
downloadgitea-14f16d6c2e8db1d99268c44a59aa86132c00eca3.tar.gz
gitea-14f16d6c2e8db1d99268c44a59aa86132c00eca3.zip
snap-packaging for gitea (#2568)
* Modify tbraeutigam/gogs-snap for gitea * Fix building on 16.04 (manually build go-bindata). -> add _source.tar.bz2 to .gitignore (used by snapcraft cleanbuild) * Streamline Snap packaging: - Take advantage of install-hooks (snapd 2.27) - Use snapctl configuration storage for unchanging values * Move to using Snap Hooks for configuration * Missed re-adding daemon statement * Fix two warnings from Codacy.
Diffstat (limited to 'snap/helpers/simple_launcher.sh')
-rwxr-xr-xsnap/helpers/simple_launcher.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/snap/helpers/simple_launcher.sh b/snap/helpers/simple_launcher.sh
new file mode 100755
index 0000000000..8a12e3b8dd
--- /dev/null
+++ b/snap/helpers/simple_launcher.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if ! env | grep -q root; then
+ echo "
+ +----------------------------------------+
+ | You are not running gitea as root. |
+ | This is required for the snap package. |
+ | Please re-run as root. |
+ +----------------------------------------+
+"
+ $SNAP/gitea/gitea --help
+ exit 1
+fi
+
+# Set usernames for gitea
+export USERNAME=root
+export USER=root
+
+export GITEA_WORK_DIR=$(snapctl get gitea.snap.workdir)
+export GITEA_CUSTOM=$(snapctl get gitea.snap.custom)
+
+$SNAP/bin/gconfig save
+cd $SNAP/gitea; ./gitea $@