How to select options in KRL web frame?

I want to run some KRL rules when updating a website. The deployment script will receive the following URL after clicking updates:

http://webhooks.kynetxapps.net/t/_appid_/updated?site=production&version=123456abcdef

The set of rules for processing this website starts as follows:

rule site_updated {
    select when webhook updated
    pre {
        site = event:param("site");
        version = event:param("version");
    }
    // do something with site and version
}

From http://docs.kynetx.com/docs/Event_API I could make more specific rules using:

select when webhook updated site "test"
    or webhook updated site "production"

Is there a way to get both parameters without a PRE block? What is the best way to use SELECT with web hosting?

+3
source share
1 answer

Rule filters (e.g. site "test") are regular expressions, and you can set variables using a clause setting ().

http://webhooks.kynetxapps.net/t/_appid_/update?site=production&version=123456abcdef

select when webhook update site "(.*)" setting(site)

site production . , , , :

select when webhook update site "(test|production)" setting(site)

site == test site == production , .

+1

Source: https://habr.com/ru/post/1778987/


All Articles