Pārlūkot izejas kodu

workspace start script

Mokhtar Naamani 4 gadi atpakaļ
vecāks
revīzija
8582428381
2 mainītis faili ar 20 papildinājumiem un 21 dzēšanām
  1. 2 0
      package.json
  2. 18 21
      start.sh

+ 2 - 0
package.json

@@ -5,6 +5,8 @@
   "license": "GPL-3.0-only",
   "scripts": {
     "postinstall": "yarn workspace @joystream/types build && yarn workspace cd-schemas generate:all && yarn workspace cd-schemas build && yarn workspace @joystream/cli build",
+    "build": "./build.sh",
+    "start": "./start.sh",
     "cargo-checks": "devops/git-hooks/pre-commit && devops/git-hooks/pre-push",
     "cargo-build": "scripts/cargo-build.sh"
   },

+ 18 - 21
start.sh

@@ -1,22 +1,20 @@
 #!/usr/bin/env bash
 set -e
 
-# Avoid pulling joystream images from docker hub. It is most likely
-# not the version that we want to work with. 
-# either build with `docker-compose build` or `docker pull` the image versions equired
-if ! docker inspect joystream/node:latest > /dev/null 2>&1;
-then
-  echo "Didn't find a joystream/node:latest docker image."
-  exit 1
-fi
-
-if ! docker inspect joystream/apps:latest > /dev/null 2>&1;
-then
-  echo "Didn't find a joystream/apps:latest docker image."
-  exit 1
-fi
-
-# clean start!
+# Run a complete joystream development network on your machine using docker.
+
+# TODO
+# - Check if docker is installed and prompt to install.
+# - Prompt user if they wish to rebuild before starting . default no, timeout if not prompted.
+# - Try to fetch a cached joystream/node image if one is found matching code shasum.
+
+# if ! docker inspect joystream/node:latest > /dev/null 2>&1;
+# then
+#   echo "Didn't find a joystream/node:latest docker image."
+#   exit 1
+# fi
+
+# Clean start!
 docker-compose down -v
 
 function down()
@@ -30,22 +28,21 @@ trap down EXIT
 # Run a development joystream-node chain
 docker-compose up -d joystream-node
 
-# configure a dev storage node and start storage node
+## Storage Infrastructure
+# Configure a dev storage node and start storage node
 DEBUG=joystream:storage-cli:dev yarn storage-cli dev-init
 docker-compose up -d colossus
-
 # Initialise the content directory with standard classes, schemas and initial entities
 yarn workspace cd-schemas initialize:dev
 
+## Query Node Infrastructure
 # Initialize a new database for the query node infrastructure
 docker-compose up -d db
 yarn workspace query-node-root db:migrate
-
 # Startup all query-node infrastructure services
 docker-compose up -d processor
 
 echo "press Ctrl+C to shutdown"
 
 # Start a dev instance of pioneer and wait for exit
-docker-compose up pioneer
-
+docker-compose up pioneer