diff options
author | Ondrej Kubik <ondrej.kubik@canonical.com> | 2017-06-26 17:04:27 +0000 |
---|---|---|
committer | Ondrej Kubik <ondrej.kubik@canonical.com> | 2017-06-27 13:22:52 +0000 |
commit | a538c149768ee565ea1b0db3ef8e3bb2a7759da0 (patch) | |
tree | 6f3afd2ad16ab2d8bca3467f1f7c71ae95402185 /snap-src/wekan-control | |
parent | 60495e4765363b95e8e1859406d80c5588062e14 (diff) | |
download | wekan-a538c149768ee565ea1b0db3ef8e3bb2a7759da0.tar.gz wekan-a538c149768ee565ea1b0db3ef8e3bb2a7759da0.tar.bz2 wekan-a538c149768ee565ea1b0db3ef8e3bb2a7759da0.zip |
Adding snapcraft build support from source
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
Diffstat (limited to 'snap-src/wekan-control')
-rwxr-xr-x | snap-src/wekan-control | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/snap-src/wekan-control b/snap-src/wekan-control new file mode 100755 index 00000000..905642ed --- /dev/null +++ b/snap-src/wekan-control @@ -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 |