-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
executable file
·119 lines (109 loc) · 2.79 KB
/
docker-entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/sh
########################################################################################################################
mkdir -p /AMIPipeline/data/node-red/
########################################################################################################################
if [ ! -f /AMIPipeline/data/node-red/flows.json ]
then
UUID=$(node -e 'console.log(require("crypto").randomUUID());')
cat > /AMIPipeline/data/node-red/flows.json << EOF
[
{
"id": "7ba8d1fbe3577553",
"type": "tab",
"label": "AMI Supervisor",
"disabled": false,
"info": "",
"env": []
},
{
"id": "9f7511e86e72a8f9",
"type": "supervisor",
"z": "7ba8d1fbe3577553",
"name": "",
"topic": "${UUID}",
"x": 370,
"y": 120,
"wires": [
[
"247c7b8f7530815a"
]
]
},
{
"id": "bc9bcef5f75eb068",
"type": "mqtt in",
"z": "7ba8d1fbe3577553",
"name": "",
"topic": "ami/taskserver/task",
"qos": "2",
"datatype": "auto",
"broker": "",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 130,
"y": 120,
"wires": [
[
"9f7511e86e72a8f9"
]
]
},
{
"id": "a8b583288f8ed783",
"type": "mqtt in",
"z": "7ba8d1fbe3577553",
"name": "topic",
"topic": "${UUID}",
"qos": "2",
"datatype": "auto",
"broker": "",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 90,
"y": 190,
"wires": [
[
"9f7511e86e72a8f9"
]
]
},
{
"id": "cca4959c8ad7dc37",
"type": "comment",
"z": "7ba8d1fbe3577553",
"name": "AMI Supervisor",
"info": "",
"x": 120,
"y": 40,
"wires": []
},
{
"id": "247c7b8f7530815a",
"type": "mqtt out",
"z": "7ba8d1fbe3577553",
"name": "ami/<server_name>/command/json",
"topic": "",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "",
"x": 660,
"y": 120,
"wires": []
}
]
EOF
fi
########################################################################################################################
npm install --force
########################################################################################################################
node ./ami-pipeline.js
########################################################################################################################