diff --git a/package_io/build-spec.star b/package_io/build-spec.star index c1f50f8..286661f 100644 --- a/package_io/build-spec.star +++ b/package_io/build-spec.star @@ -19,7 +19,8 @@ def create_service_for_build_spec(plan, service_name, image, build_file): def create_edit_and_build_spec(plan, service_name, image, chain_name, command, build_file): service = create_service_for_build_spec(plan, service_name, image, build_file) - plan.exec(service_name = service_name, recipe = command) + result = plan.exec(service_name = service_name, recipe = command) + plan.verify(result["code"], "==", 0) plan.store_service_files(service_name = service_name, src = "/tmp/{0}.json".format(chain_name), name = service_name) diff --git a/parachain/build-spec.star b/parachain/build-spec.star index 54b14d6..1a2c68e 100644 --- a/parachain/build-spec.star +++ b/parachain/build-spec.star @@ -26,21 +26,24 @@ def create_raw_build_spec_genisis_state_genisis_wasm(plan, binary, image, chain_ "-c", "{0} build-spec --chain=/build/{1}.json --raw --disable-default-bootnode > /tmp/{1}-raw.json".format(binary, chain_name), ]) - plan.exec(service_name = constant.RAW_BUILD_SPEC, recipe = command) + result = plan.exec(service_name = constant.RAW_BUILD_SPEC, recipe = command) + plan.verify(result["code"], "==", 0) command = ExecRecipe(command = [ "/bin/sh", "-c", "{0} export-genesis-wasm --chain=/tmp/{1}-raw.json > /tmp/{1}-genesis-wasm".format(binary, chain_name), ]) - plan.exec(service_name = constant.RAW_BUILD_SPEC, recipe = command) + result = plan.exec(service_name = constant.RAW_BUILD_SPEC, recipe = command) + plan.verify(result["code"], "==", 0) command = ExecRecipe(command = [ "/bin/sh", "-c", "{0} export-genesis-state --chain=/tmp/{1}-raw.json > /tmp/{1}-genesis-state".format(binary, chain_name), ]) - plan.exec(service_name = constant.RAW_BUILD_SPEC, recipe = command) + result = plan.exec(service_name = constant.RAW_BUILD_SPEC, recipe = command) + plan.verify(result["code"], "==", 0) # command = ExecRecipe(command = [ # "/bin/sh", diff --git a/parachain/register-para-id.star b/parachain/register-para-id.star index b62e47a..187a503 100644 --- a/parachain/register-para-id.star +++ b/parachain/register-para-id.star @@ -4,10 +4,12 @@ constant = import_module("../package_io/constant.star") def register_para_id(plan, alice_ip): plan.upload_files(src = "./static_files/javascript", name = "javascript") test = build_spec.create_service_for_build_spec(plan, constant.PARA_SLOT_REGISTER_SERVICE_NAME, constant.NODE_IMAGE, "javascript") - plan.exec(service_name = test.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cd /build && npm i "])) - plan.exec(service_name = test.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cd /build && node register ws://{0}:9944 //Alice ".format(alice_ip)])) + result = plan.exec(service_name = test.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cd /build && npm i "])) + plan.verify(result["code"], "==", 0) + result = plan.exec(service_name = test.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cd /build && node register ws://{0}:9944 //Alice ".format(alice_ip)])) + plan.verify(result["code"], "==", 0) para_id = plan.exec(service_name = test.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cat /tmp/para.json | tr -d '\n\r'"])) - + plan.verify(para_id["code"], "==", 0) plan.remove_service(test.name) return para_id["output"] @@ -25,7 +27,9 @@ def onboard_genesis_state_and_wasm(plan, para_id, chain_name, alice_ip): ), ) - plan.exec(service_name = service.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cd /javascript && npm i "])) - plan.exec(service_name = service.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cd /javascript && node onboard ws://{0}:9944 //Alice {1} /build/{2}-genesis-state /build/{2}-genesis-wasm".format(alice_ip, para_id, chain_name)])) + result = plan.exec(service_name = service.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cd /javascript && npm i "])) + plan.verify(result["code"], "==", 0) + result = plan.exec(service_name = service.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cd /javascript && node onboard ws://{0}:9944 //Alice {1} /build/{2}-genesis-state /build/{2}-genesis-wasm".format(alice_ip, para_id, chain_name)])) + plan.verify(result["code"], "==", 0) plan.remove_service(service.name)