|
@@ -8,18 +8,30 @@ then
|
|
|
exit 0
|
|
|
fi
|
|
|
|
|
|
+# Build or fetch cached joystream/node docker image
|
|
|
+if [[ "$SKIP_JOYSTREAM_NODE" = 1 || "$SKIP_JOYSTREAM_NODE" = "true" ]]; then
|
|
|
+ echo "Skipping build of joystream/node docker image."
|
|
|
+else
|
|
|
+ # Fetch a cached joystream/node image if one is found matching code shasum instead of building
|
|
|
+ CODE_HASH=`scripts/runtime-code-shasum.sh`
|
|
|
+ IMAGE=joystream/node:${CODE_HASH}
|
|
|
+ echo "Trying to fetch cashed ${IMAGE} image"
|
|
|
+ docker pull ${IMAGE} || :
|
|
|
+
|
|
|
+ if ! docker inspect ${IMAGE} > /dev/null;
|
|
|
+ then
|
|
|
+ echo "Fetch failed, building image locally"
|
|
|
+ docker-compose build joystream-node
|
|
|
+ else
|
|
|
+ echo "Tagging cached image as 'latest'"
|
|
|
+ docker image tag ${IMAGE} joystream/node:latest
|
|
|
+ fi
|
|
|
+fi
|
|
|
+
|
|
|
# Build joystream/apps docker image
|
|
|
echo "Building 'joystream/apps' docker image..."
|
|
|
docker-compose build colossus
|
|
|
|
|
|
# Build the pioneer docker image
|
|
|
echo "Building pioneer docker image"
|
|
|
-docker-compose build pioneer
|
|
|
-
|
|
|
-if [[ "$SKIP_JOYSTREAM_NODE" = 1 || "$SKIP_JOYSTREAM_NODE" = "true" ]]; then
|
|
|
- echo "Skipping build of joystream/node docker image."
|
|
|
-else
|
|
|
- # TODO: Try to fetch a cached joystream/node image
|
|
|
- # if one is found matching code shasum instead of building
|
|
|
- docker-compose build joystream-node
|
|
|
-fi
|
|
|
+docker-compose build pioneer
|