Ver código fonte

pass ALL_PROPOSALS_PARAMETERS_JSON as build arg to dockerfile

Mokhtar Naamani 3 anos atrás
pai
commit
9178ccb1a7
3 arquivos alterados com 9 adições e 2 exclusões
  1. 5 1
      build-node-docker.sh
  2. 2 1
      joystream-node.Dockerfile
  3. 2 0
      scripts/cargo-build.sh

+ 5 - 1
build-node-docker.sh

@@ -8,6 +8,8 @@ set -e
 CODE_HASH=`scripts/runtime-code-shasum.sh`
 IMAGE=joystream/node:${CODE_HASH}
 
+# TODO: Check for valid JSON in ALL_PROPOSALS_PARAMETERS_JSON ?
+
 # Look for image locally
 if ! docker inspect ${IMAGE} > /dev/null;
 then
@@ -19,7 +21,9 @@ then
   if ! docker inspect ${IMAGE} > /dev/null;
   then
     echo "Building ${IMAGE}.."
-    docker build . --file joystream-node.Dockerfile --tag ${IMAGE} --build-arg TEST_NODE=${TEST_NODE}
+    docker build . --file joystream-node.Dockerfile --tag ${IMAGE} \
+	    --build-arg TEST_NODE=${TEST_NODE} \
+	    --build-arg ALL_PROPOSALS_PARAMETERS_JSON=${ALL_PROPOSALS_PARAMETERS_JSON}
   fi
 else
   echo "Found ${IMAGE} in local repo"

+ 2 - 1
joystream-node.Dockerfile

@@ -14,13 +14,14 @@ COPY . /joystream
 
 # Build all cargo crates
 # Ensure our tests and linter pass before actual build
-ENV WASM_BUILD_TOOLCHAIN=nightly-2021-02-20
+ARG ALL_PROPOSALS_PARAMETERS_JSON
 ARG TEST_NODE
 RUN echo "TEST_NODE=$TEST_NODE"
 RUN test -n "$TEST_NODE" && sed -i 's/MILLISECS_PER_BLOCK: Moment = 6000/MILLISECS_PER_BLOCK: Moment = 1000/' ./runtime/src/constants.rs; exit 0
 RUN test -n "$TEST_NODE" && sed -i 's/SLOT_DURATION: Moment = 6000/SLOT_DURATION: Moment = 1000/' ./runtime/src/constants.rs; exit 0
 RUN test -n "$TEST_NODE" && export ALL_PROPOSALS_PARAMETERS_JSON="$(cat ./tests/integration-tests/proposal-parameters.json)";\
     echo "ALL_PROPOSALS_PARAMETERS_JSON=$ALL_PROPOSALS_PARAMETERS_JSON" && \
+    export WASM_BUILD_TOOLCHAIN=nightly-2021-02-20 && \
     BUILD_DUMMY_WASM_BINARY=1 cargo clippy --release --all -- -D warnings && \
     cargo test --release --all && \
     cargo build --release

+ 2 - 0
scripts/cargo-build.sh

@@ -1,5 +1,7 @@
 #!/usr/bin/env bash
 
+# TODO: Check for valid JSON in ALL_PROPOSALS_PARAMETERS_JSON ?
+
 export WASM_BUILD_TOOLCHAIN=nightly-2021-02-20
 
 cargo +nightly-2021-02-20 build --release