diff --git a/scripts/srtool/build-srtool-image.sh b/scripts/srtool/build-srtool-image.sh new file mode 100755 index 000000000..d736fe8a1 --- /dev/null +++ b/scripts/srtool/build-srtool-image.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker build --build-arg RUSTC_VERSION="1.85.0" -t srtool https://github.com/paritytech/srtool.git#refs/tags/v0.17.0 \ No newline at end of file diff --git a/scripts/srtool/run-srtool.sh b/scripts/srtool/run-srtool.sh new file mode 100755 index 000000000..4719f7a4b --- /dev/null +++ b/scripts/srtool/run-srtool.sh @@ -0,0 +1,26 @@ +#!/bin/bash +if [ -z "$CARGO_HOME" ]; then + echo "CARGO_HOME is not set" + exit 1 +fi + +cd runtime # check for symlink +if [ ! -L node-subtensor ]; then + ln -s . node-subtensor +fi +cd .. + +docker run --rm --user root --platform=linux/amd64 \ + -e PACKAGE=node-subtensor-runtime \ + -e BUILD_OPTS="--features=metadata-hash" \ + -e PROFILE=production \ + -v $HOME/.cargo:/cargo-home \ + -v $(pwd):/build \ + -it srtool bash -c "git config --global --add safe.directory /build && \ + /srtool/build --app > /build/runtime/node-subtensor/srtool-output.log; \ + BUILD_EXIT_CODE=\$?; \ + if [ \"\$BUILD_EXIT_CODE\" -ne 0 ]; then \ + cat /build/runtime/node-subtensor/srtool-output.log; \ + exit \$BUILD_EXIT_CODE; \ + fi && \ + tail -n 1 /build/runtime/node-subtensor/srtool-output.log > /build/runtime/node-subtensor/subtensor-digest.json" \ No newline at end of file