mirror of
https://github.com/wekan/wekan.git
synced 2026-01-28 04:06:10 +01:00
Adding snapcraft build support from source
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
This commit is contained in:
parent
60495e4765
commit
a538c14976
11 changed files with 385 additions and 0 deletions
26
snap-src/wekan-control
Executable file
26
snap-src/wekan-control
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/bash
|
||||
|
||||
SYSTEMD_WEKAN_SERVICE="snap.${SNAP_NAME}.wekan"
|
||||
SYSTEMD_MONGODB_SERVICE="snap.${SNAP_NAME}.mongodb"
|
||||
|
||||
# get wekan/mongo settings
|
||||
source $SNAP/bin/wekan-read-settings
|
||||
|
||||
export NODE_PATH=$SNAP/bin
|
||||
# if possible we prefer to bind over unix socket
|
||||
if [ "nill" != "$MONGODB_BIND_UNIX_SOCKET" ] && [ "x" != "x$MONGODB_BIND_UNIX_SOCKET" ]; then
|
||||
if [ -d $MONGODB_BIND_UNIX_SOCKET ]; then
|
||||
export MONGO_URL="mongodb://$MONGODB_BIND_UNIX_SOCKET/mongodb-${MONGODB_PORT}.sock/wekan"
|
||||
else
|
||||
export MONGO_URL="mongodb://$SNAP_DATA/shared/$MONGODB_BIND_UNIX_SOCKET/wekan"
|
||||
fi
|
||||
else
|
||||
[ "x" == "x$MONGODB_BIND_IP" ] && MONGODB_BIND_IP="127.0.0.1"
|
||||
export MONGO_URL="mongodb://$MONGODB_BIND_IP:$MONGODB_PORT/wekan"
|
||||
fi
|
||||
|
||||
echo -e "MONGO_URL=$MONGO_URL"
|
||||
APPLICATION_DIRECTORY=$SNAP
|
||||
APPLICATION_START=main.js
|
||||
cd $APPLICATION_DIRECTORY
|
||||
$NODE_PATH/node $APPLICATION_START
|
||||
Loading…
Add table
Add a link
Reference in a new issue