|
@@ -1,6 +1,14 @@
|
|
#!/usr/bin/env bash
|
|
#!/usr/bin/env bash
|
|
set -e
|
|
set -e
|
|
|
|
|
|
|
|
+function cleanup()
|
|
|
|
+{
|
|
|
|
+ docker stop ${CONTAINER_ID}
|
|
|
|
+ docker rm ${CONTAINER_ID}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+trap cleanup EXIT
|
|
|
|
+
|
|
# Location that will be mounted as the /data volume in containers
|
|
# Location that will be mounted as the /data volume in containers
|
|
# This is how we access the initial members and balances files from
|
|
# This is how we access the initial members and balances files from
|
|
# the containers and where generated chainspec files will be located.
|
|
# the containers and where generated chainspec files will be located.
|
|
@@ -30,7 +38,7 @@ echo '
|
|
' > ${DATA_PATH}/initial-members.json
|
|
' > ${DATA_PATH}/initial-members.json
|
|
|
|
|
|
# Create a chain spec file
|
|
# Create a chain spec file
|
|
-docker run -v ${DATA_PATH}:/data --entrypoint ./chain-spec-builder joystream/node \
|
|
|
|
|
|
+docker run --rm -v ${DATA_PATH}:/data --entrypoint ./chain-spec-builder joystream/node \
|
|
new \
|
|
new \
|
|
--authority-seeds Alice \
|
|
--authority-seeds Alice \
|
|
--sudo-account 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY \
|
|
--sudo-account 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY \
|
|
@@ -40,14 +48,16 @@ docker run -v ${DATA_PATH}:/data --entrypoint ./chain-spec-builder joystream/nod
|
|
--initial-members-path /data/initial-members.json
|
|
--initial-members-path /data/initial-members.json
|
|
|
|
|
|
# Convert the chain spec file to a raw chainspec file
|
|
# Convert the chain spec file to a raw chainspec file
|
|
-docker run -v ${DATA_PATH}:/data joystream/node build-spec \
|
|
|
|
|
|
+docker run --rm -v ${DATA_PATH}:/data joystream/node build-spec \
|
|
--raw --disable-default-bootnode \
|
|
--raw --disable-default-bootnode \
|
|
--chain /data/chain-spec.json > ~/tmp/chain-spec-raw.json
|
|
--chain /data/chain-spec.json > ~/tmp/chain-spec-raw.json
|
|
|
|
|
|
# Start a chain with generated chain spec
|
|
# Start a chain with generated chain spec
|
|
-docker run -v ${DATA_PATH}:/data -d -p 9944:9944 joystream/node \
|
|
|
|
|
|
+CONTAINER_ID=`docker run -d -v ${DATA_PATH}:/data -p 9944:9944 joystream/node \
|
|
--validator --alice --unsafe-ws-external --rpc-cors=all --log runtime \
|
|
--validator --alice --unsafe-ws-external --rpc-cors=all --log runtime \
|
|
- --chain /data/chain-spec-raw.json
|
|
|
|
|
|
+ --chain /data/chain-spec-raw.json`
|
|
|
|
+
|
|
|
|
+# Execute the tests then stop the container
|
|
|
|
+yarn workspace network-tests test || echo "Failed Running Tests"
|
|
|
|
|
|
-# Execute the tests
|
|
|
|
-yarn workspace network-tests test
|
|
|
|
|
|
+cleanup()
|