examples/archived/multi-service/scripts/deploy.sh

20 lines
571 B
Bash
Raw Normal View History

2021-03-01 23:03:57 +00:00
#!/usr/bin/env bash
set -euo pipefail
# check `fcli` and `fldist` tools are installed or install them
2021-06-16 22:06:49 +00:00
(command -v marine || cargo install marine) >/dev/null
2021-03-01 23:03:57 +00:00
(command -v fldist || npm install -g @fluencelabs/fldist) >/dev/null
# build .wasm
(
cd backend
2021-06-16 22:06:49 +00:00
marine build --release
2021-03-01 23:03:57 +00:00
)
# check it .wasm was built
WASM="backend/target/wasm32-wasi/release/curl_template.wasm"
test -f "$WASM" || echo >&2 "Couldn't find $WASM"
# create a service from that .wasm
CONFIG="$(pwd)/backend/BackendConfig.json"
fldist new_service --modules "$WASM:$CONFIG" --name curl_template