mirror of
https://github.com/valitydev/holmes.git
synced 2024-11-06 01:45:25 +00:00
4cdec0411f
* Switch proto upstreams to valitydev: valitydev/bender-proto@38ce3ff valitydev/binbase-proto@9db92d9 valitydev/cds-proto@ed9f907 valitydev/damsel@d384c12 valitydev/fistful-proto@c45166d valitydev/limiter-proto@8c08550 valitydev/machinegun-proto@af57ba1 valitydev/msgpack-proto@8742c7a * Rewrite Dockerfile * Include protocols as full-fledged git repos * Add GH Actions CI workflow
50 lines
1.0 KiB
Bash
Executable File
50 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
CWD="$(dirname $0)"
|
|
MGPROTO="${CWD}/../machinegun-proto"
|
|
|
|
USAGE=$(cat <<EOF
|
|
Usage: ${SCRIPTNAME} id [ns]
|
|
Fails a machine. Exploits the fact that most if not all already implemented
|
|
machines do not tolerate arbitrary machinegun calls so it throws nils at them
|
|
as a call args.
|
|
id Machine ID (string)
|
|
ns Machine namespace (string, default = invoice)
|
|
|
|
More information:
|
|
https://github.com/valitydev/machinegun-proto
|
|
EOF
|
|
)
|
|
|
|
function usage {
|
|
echo "${USAGE}"
|
|
exit 127
|
|
}
|
|
|
|
[ -f woorlrc ] && source woorlrc
|
|
|
|
ID="${1}"
|
|
NS="${2:-invoice}"
|
|
[ -z "${ID}" ] && usage
|
|
|
|
MACHINEDESC=$(cat <<END
|
|
{
|
|
"ns": "${NS}",
|
|
"ref": {"id": "${ID}"},
|
|
"range": {"limit": 1, "direction": "forward"}
|
|
}
|
|
END
|
|
)
|
|
|
|
CALLARGS=$(cat <<END
|
|
{
|
|
"bin": {"content_type": "base64", "content": "g2o="}
|
|
}
|
|
END
|
|
)
|
|
|
|
"${WOORL[@]:-woorl}" -s "${MGPROTO}/proto/state_processing.thrift" \
|
|
"http://${MACHINEGUN:-machinegun}:${MACHINEGUN_PORT:-8022}/v1/automaton" \
|
|
Automaton Call "${MACHINEDESC}" "${CALLARGS}" \
|
|
| grep -sqF 'MachineFailed'
|