examples/curl_template/deploy.sh
2021-02-26 00:18:07 +03:00

21 lines
564 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# check `fcli` and `fldist` tools are installed or install them
(command -v fce || cargo install fcli) >/dev/null
(command -v fldist || npm install -g @fluencelabs/fldist) >/dev/null
# build .wasm
(
cd backend
fce build --release
)
# 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