summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Warner <warnerjon12@gmail.com>2018-11-12 03:51:44 -0700
committerJonathan Warner <warnerjon12@gmail.com>2018-11-12 05:45:51 -0700
commit22a9e783c99b56db688793ad3736bd1e3fc20f40 (patch)
tree85bc85d372a7c1f9e9bdfe3ee5530273a02f0157
parentd4e75165dde4977f8354170d4367a4c5213b122c (diff)
downloadwekan-22a9e783c99b56db688793ad3736bd1e3fc20f40.tar.gz
wekan-22a9e783c99b56db688793ad3736bd1e3fc20f40.tar.bz2
wekan-22a9e783c99b56db688793ad3736bd1e3fc20f40.zip
Revised shell scripts to check for wekan repository
The scripts used to assume that ~/repos/wekan was a local wekan repo. They now check that the active directory is a wekan repo.
-rwxr-xr-xrebuild-wekan.sh12
-rwxr-xr-xstart-wekan.sh26
-rwxr-xr-xstatus-wekan.sh4
-rwxr-xr-xstop-wekan.sh2
4 files changed, 33 insertions, 11 deletions
diff --git a/rebuild-wekan.sh b/rebuild-wekan.sh
index 03586489..42364515 100755
--- a/rebuild-wekan.sh
+++ b/rebuild-wekan.sh
@@ -134,10 +134,10 @@ do
;;
"Build Wekan")
echo "Building Wekan."
- cd ~/repos/wekan
+ wekan_repo_check
rm -rf packages
- mkdir -p ~/repos/wekan/packages
- cd ~/repos/wekan/packages
+ mkdir packages
+ cd packages
git clone --depth 1 -b master https://github.com/wekan/flow-router.git kadira-flow-router
git clone --depth 1 -b master https://github.com/meteor-useraccounts/core.git meteor-useraccounts-core
git clone --depth 1 -b master https://github.com/wekan/meteor-accounts-cas.git
@@ -150,7 +150,7 @@ do
sed -i 's/api\.versionsFrom/\/\/api.versionsFrom/' ~/repos/wekan/packages/meteor-useraccounts-core/package.js
fi
- cd ~/repos/wekan
+ cd ..
rm -rf node_modules
meteor npm install
rm -rf .build
@@ -162,11 +162,11 @@ do
#cd ~/repos/wekan/.build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt
#rm -rf node_modules/bcrypt
#meteor npm install bcrypt
- cd ~/repos/wekan/.build/bundle/programs/server
+ cd .build/bundle/programs/server
rm -rf node_modules
meteor npm install
#meteor npm install bcrypt
- cd ~/repos
+ cd ../../../..
echo Done.
break
;;
diff --git a/start-wekan.sh b/start-wekan.sh
index 6006fb92..3584ac6d 100755
--- a/start-wekan.sh
+++ b/start-wekan.sh
@@ -1,7 +1,25 @@
-# If you want to restart even on crash, uncomment while and done lines.
+#!/bin/bash
+
+function wekan_repo_check(){
+ git_remotes="$(git remote show 2>/dev/null)"
+ res=""
+ for i in $git_remotes; do
+ res="$(git remote get-url $i | sed 's/.*wekan\/wekan.*/wekan\/wekan/')"
+ if [[ "$res" == "wekan/wekan" ]]; then
+ break
+ fi
+ done
+ if [[ "$res" != "wekan/wekan" ]]; then
+ echo "$PWD is not a wekan repository"
+ exit;
+ fi
+}
+
+# If you want to restart even on crash, uncomment while and done lines.
#while true; do
- cd ~/repos/wekan/.build/bundle
+ wekan_repo_check
+ cd .build/bundle
#export MONGO_URL='mongodb://127.0.0.1:27019/wekantest'
#export MONGO_URL='mongodb://127.0.0.1:27019/wekan'
export MONGO_URL='mongodb://127.0.0.1:27019/wekantest'
@@ -18,6 +36,6 @@
export PORT=2000
#export LDAP_ENABLE=true
node main.js
- # & >> ~/repos/wekan.log
- cd ~/repos
+ # & >> ../../wekan.log
+ cd ../..
#done
diff --git a/status-wekan.sh b/status-wekan.sh
index 2b815f4a..3b0f232d 100755
--- a/status-wekan.sh
+++ b/status-wekan.sh
@@ -1,5 +1,7 @@
+#!/bin/sh
+
echo -e "\nWekan node.js:"
ps aux | grep "node main.js" | grep -v grep
echo -e "\nWekan mongodb:"
ps aux | grep mongo | grep -v grep
-echo -e "\nWekan logs are at /home/wekan/repos/wekan.log\n"
+echo -e "\nWekan logs are at $PWD/wekan.log\n"
diff --git a/stop-wekan.sh b/stop-wekan.sh
index a7adf03b..8865a83a 100755
--- a/stop-wekan.sh
+++ b/stop-wekan.sh
@@ -1 +1,3 @@
+#!/bin/sh
+
pkill -f "node main.js"