Browse Source

Shifting around files ready for chainspace docker

Jim Barritt 11 months ago
parent
commit
3d161df468

+ 2 - 2
apps/petitions/decode-app/do.sh

@@ -32,12 +32,12 @@ function status {
32 32
 
33 33
 
34 34
 function up {
35
-    mongo up
35
+    mongo start
36 36
 }
37 37
 
38 38
 
39 39
 function down {
40
-    mongo down
40
+    mongo stop
41 41
 }
42 42
 
43 43
 

apps/petitions/decode-app/ops/local/mongo.docker-compose.yml → apps/petitions/decode-app/ops/local/_docker-compose.yml


+ 6 - 1
apps/petitions/decode-app/ops/local/_env.sh

@@ -1,8 +1,13 @@
1 1
 #!/usr/bin/env bash
2 2
 
3
-
3
+SCRIPT_HOME=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
4 4
 
5 5
 APP_NAME="decode/app"
6 6
 
7 7
 CLUSTER_NAME="petitions-app"
8 8
 
9
+DOCKER_COMPOSE_CONFIG=${SCRIPT_HOME}/_docker-compose.yml
10
+
11
+source ${SCRIPT_HOME}/_lib.sh
12
+
13
+

+ 2 - 3
apps/petitions/decode-app/ops/local/mongo.lib.sh

@@ -1,16 +1,15 @@
1 1
 #!/usr/bin/env bash
2 2
 
3 3
 SCRIPT_HOME=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
4
-
5 4
 source ${SCRIPT_HOME}/_env.sh
6
-source ${SCRIPT_HOME}/_lib.sh
7 5
 
8
-DOCKER_COMPOSE_CONFIG=${SCRIPT_HOME}/mongo.docker-compose.yml
9 6
 
10 7
 MONGO_HOST="localhost"
11 8
 MONGO_PORT=27017
12 9
 MONGO_URL="http://${MONGO_HOST}:${MONGO_PORT}"
13 10
 
11
+
12
+
14 13
 DOCKER_COMMAND="docker-compose -f ${DOCKER_COMPOSE_CONFIG}"
15 14
 
16 15
 

+ 12 - 5
apps/petitions/decode-app/ops/local/mongo.sh

@@ -15,7 +15,7 @@ source ${SCRIPT_HOME}/mongo.lib.sh
15 15
 function status {
16 16
     echo -e "Status of local mongo docker:\n"
17 17
     echo -e "Docker Config: \n${DOCKER_COMPOSE_CONFIG}\n"
18
-    ${DOCKER_COMMAND} ps
18
+    ${DOCKER_COMMAND} ps mongo
19 19
 
20 20
     HTTP_STATUS=$(lib/http_status_of ${MONGO_URL})
21 21
 
@@ -41,19 +41,26 @@ function logs {
41 41
     esac
42 42
 }
43 43
 
44
-function up {
44
+function start {
45 45
     echo -e "\nStarting local docker container with mongo (run [${SCRIPT_HOME}/mongo.sh docker-logs] to see details)\n"
46
-    ${DOCKER_COMMAND}  up -d
46
+    ${DOCKER_COMMAND} start mongo
47 47
     lib/wait_for_service ${MONGO_URL}
48 48
     status
49 49
 }
50 50
 
51
-function down {
51
+function stop {
52 52
     echo "Stopping local mongo docker container ...\n"
53
-    ${DOCKER_COMMAND} down
53
+    ${DOCKER_COMMAND} stop mongo
54 54
     echo -e "\nMongo stopped."
55 55
 }
56 56
 
57
+function restart {
58
+    echo "Restarting local mongo docker container ...\n"
59
+    ${DOCKER_COMMAND} restart mongo
60
+    echo -e "\nMongo stopped."
61
+}
62
+
63
+
57 64
 function shell {
58 65
     mongo/shell
59 66
 }