Connect local SXCHNGE to the Sendico stand
This commit was merged in pull request #53.
This commit is contained in:
1 parent
34d8ef18d1
commit
a5689876ff
14 files changed
+336
-9
No files matched your search
@@ -0,0 +1,20 @@
|
||||
# Operator input is JSON on stdin. Only credential values are stored in Vault.
|
||||
configure_sendico() {
|
||||
existing
|
||||
cat > "$WORK/input"
|
||||
jq -e '
|
||||
(.organization_ref|test("^[0-9a-f]{24}$") and .!="000000000000000000000000") and
|
||||
(.source_account_ref|test("^[0-9a-f]{24}$") and .!="000000000000000000000000") and
|
||||
([.client_id,.device_id,.login,.password,.client_secret] | all(.[]; type=="string" and test("\\S"))) and
|
||||
([.client_id,.device_id] | all(.[]; test("^[A-Za-z0-9._-]+$")))
|
||||
' "$WORK/input" >/dev/null || fail 'Invalid Sendico operator input'
|
||||
jq '{login,password,client_secret}' "$WORK/input" | put services/bff/sendico
|
||||
mkdir -p "$STATE/sendico"
|
||||
jq -r '"SENDICO_ORGANIZATION_REF="+.organization_ref+"\nSENDICO_SOURCE_ACCOUNT_REF="+.source_account_ref+"\nSENDICO_CLIENT_ID="+.client_id+"\nSENDICO_DEVICE_ID="+.device_id' "$WORK/input" | write "$STATE/sendico/settings.env"
|
||||
{
|
||||
cat infra/local/bff/runtime.yml
|
||||
jq -r '"\n sendico:\n api_url: http://127.0.0.1:18081/api/v1\n organization_ref: "+.organization_ref+"\n source_account_ref: "+.source_account_ref+"\n token_file: /run/sendico/access-token"' "$WORK/input"
|
||||
} | write "$STATE/sendico/runtime.yml" 644
|
||||
provision_agents
|
||||
echo 'Local Sendico connection configured. Run make up.'
|
||||
}
|
||||
Reference in new issue
Block a user