@transitive-sdk/utils-caps 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docker.sh +9 -4
- package/package.json +1 -1
package/docker.sh
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# Script to run cloud caps in docker. This tries to replicate what we do in
|
|
5
5
|
# cloud/app/docker.js, just for dev.
|
|
6
|
-
# Usage:
|
|
6
|
+
# Usage: invoked by subScript via `npm start` (part of utils-caps)
|
|
7
7
|
|
|
8
8
|
set -e
|
|
9
9
|
|
|
@@ -59,7 +59,11 @@ docker build -f $DIR/Dockerfile -t $TAG \
|
|
|
59
59
|
$TMPDIR
|
|
60
60
|
|
|
61
61
|
mkdir -p /tmp/pers/common
|
|
62
|
-
|
|
62
|
+
PERS_CAP_DIR=/tmp/pers/${CAP_NAME//\"/}
|
|
63
|
+
mkdir -p $PERS_CAP_DIR
|
|
64
|
+
|
|
65
|
+
# bind mounts for all .js files in capability root folder
|
|
66
|
+
jsFiles=$(for n in *.js; do echo -v $PWD/$n:/app/$n; done)
|
|
63
67
|
|
|
64
68
|
docker run -it --rm --init \
|
|
65
69
|
--env MQTT_URL=mqtts://mosquitto \
|
|
@@ -68,11 +72,12 @@ docker run -it --rm --init \
|
|
|
68
72
|
--env MONGO_URL="mongodb://mongodb" \
|
|
69
73
|
-p $PORT:1000 -p $PORT:1000/udp \
|
|
70
74
|
-v /tmp/pers/common:/persistent/common \
|
|
71
|
-
-v
|
|
75
|
+
-v $PERS_CAP_DIR:/persistent/self \
|
|
76
|
+
-v $PWD/cloud:/app/cloud \
|
|
77
|
+
$jsFiles \
|
|
72
78
|
--network=cloud_caps \
|
|
73
79
|
--name $CONTAINER_NAME \
|
|
74
80
|
$TAG $@
|
|
75
|
-
# -v $PWD/cloud:/app/cloud \
|
|
76
81
|
|
|
77
82
|
# not in use by any capabilities right now:
|
|
78
83
|
# --env MIN_PORT=$MIN_PORT \
|