Browse Source

Creating a new top level script

Jim Barritt 11 months ago
parent
commit
49ec3dfa55
2 changed files with 40 additions and 0 deletions
  1. 39 0
      apps/petitions/decode-app/do.sh
  2. 1 0
      apps/petitions/decode-app/ops/local/mongo.sh

+ 39 - 0
apps/petitions/decode-app/do.sh

@@ -0,0 +1,39 @@
1
+#!/usr/bin/env bash
2
+
3
+# This is an entry point for all the bash scripting that we provide with this module
4
+# We also provide a makefile with some convenient shortcuts, but everything can be done from here for more fine grained control
5
+
6
+set -e # Exit script if anything fails
7
+set -u # unset variables cause an error
8
+set -o pipefail # https://coderwall.com/p/fkfaqq/safer-bash-scripts-with-set-euxo-pipefail
9
+#set -x # for debugging each command
10
+
11
+source ./ops/local/lib.sh
12
+
13
+function install {
14
+    echo -e "'nInstalling 'do' alias so you just have to type 'do ...' instead of './do.sh' ...\n"
15
+    alias do="./do.sh"
16
+    echo -e "\nIf you want this permanenently just add it to your '.bashrc' file\n"
17
+
18
+}
19
+
20
+function mongo {
21
+    ./ops/local/mongo.sh $@
22
+}
23
+
24
+function status {
25
+    mongo status
26
+}
27
+
28
+
29
+function up {
30
+    mongo up
31
+}
32
+
33
+
34
+function down {
35
+    mongo down
36
+}
37
+
38
+
39
+lib/process_commands $@

+ 1 - 0
apps/petitions/decode-app/ops/local/mongo.sh

@@ -59,4 +59,5 @@ function down {
59 59
     ${DOCKER_COMMAND} down
60 60
     echo -e "\nMongo stopped."
61 61
 }
62
+
62 63
 lib/process_commands $@