{"id":295246,"date":"2019-11-26T21:00:14","date_gmt":"2019-11-26T21:00:14","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=295246"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=295246","title":{"rendered":"\u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk, \u0447\u0430\u0441\u0442\u044c 2"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477628\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yk\/jd\/cb\/ykjdcbuozxj70sxwrtxebx0l6u8.png\"><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0446\u0438\u043a\u043b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043d\u044b\u0445 \u0437\u0430\u043c\u0435\u0442\u043e\u043a \u043e\u0431 OpenWhisk \u043e\u0442 \u0430\u0432\u0442\u043e\u0440\u0430 <a href=\"https:\/\/medium.com\/@pdesai8\">Priti Desai<\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f GitHub webhook, \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 Slack.<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h2 id=\"github-webhook\">GitHub webhook<\/h2>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 OpenWhisk \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f\u043c\u0438 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, push, pull request \u0438 \u0442.\u043f.) \u0438\u0437 <a href=\"https:\/\/github.com\/openwhisk\/openwhisk-catalog\/blob\/master\/packages\/github\/README.md\">\u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f GitHub<\/a>.<br \/>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 GitHub webhook, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <em>wskdeploy<\/em>.<\/p>\n<p>  <\/p>\n<h3 id=\"shag-pervyy\">\u0428\u0430\u0433 \u043f\u0435\u0440\u0432\u044b\u0439<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442:<\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0441 GitHub \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439 <code>\/whisk.system\/github\/webhook<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">packages:     helloworld:         actions:             helloworld:                 location: src\/hello.js                 runtime: nodejs:6                 inputs:                     name:                         type: string                         description: name of a person                     place:                         type: string                         description: location of a person                 outputs:                     payload:                         type: string                         description: a simple greeting message, Hello World!         triggers:             GitHubWebhookTrigger:                 feed: \/whisk.system\/github\/webhook         rules:             helloworldOnWebhook:                 action: helloworld                 trigger: GitHubWebhookTrigger<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-vtoroy\">\u0428\u0430\u0433 \u0432\u0442\u043e\u0440\u043e\u0439<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 <code>username<\/code>, <code>repository<\/code>, <code>accessToken<\/code> \u0438 <code>events<\/code> \u0434\u043b\u044f \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 <strong>GitHubWebhookTrigger<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">application:     name: SampleHelloWorld     namespace: _     packages:         helloworld:             actions:                 helloworld:                     inputs:                         name: Amy                         place: Paris             triggers:                 GitHubWebhookTrigger:                     inputs:                         username: pritidesai                         repository: pritidesai\/helloworld                         accessToken: &lt;accessToken&gt;                         events: push<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-tretiy\">\u0428\u0430\u0433 \u0442\u0440\u0435\u0442\u0438\u0439<\/h3>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">.\/wskdeploy -p ~\/SampleHelloWorldApp\/          ____      ___                   _    _ _     _     _         \/\\   \\    \/ _ \\ _ __   ___ _ __ | |  | | |__ (_)___| | __    \/\\  \/__\\   \\  | | | | '_ \\ \/ _ \\ '_ \\| |  | | '_ \\| \/ __| |\/ \/   \/  \\____ \\  \/  | |_| | |_) |  __\/ | | | |\/\\| | | | | \\__ \\   &lt;   \\   \\  \/  \\\/    \\___\/| .__\/ \\___|_| |_|__\/\\__|_| |_|_|___\/_|\\_\\    \\___\\\/              |_| Packages: Name: helloworld     bindings:   * action: helloworld     bindings:         - name: name value: Amy         - name: place value: Paris Triggers: * trigger: GitHubWebhookTrigger     bindings:         - name: accessToken value: ****         - name: events value: push         - name: username value: pritidesai         - name: repository value: pritidesai\/helloworld     annotations:         - name: feed value: \/whisk.system\/github\/webhook Rules * rule: helloworldOnWebhook     - trigger: GitHubWebhookTrigger     - action: helloworld Do you really want to deploy this? (y\/N): y Deploying package helloworld ... Done! Deploying action helloworld\/helloworld ... Done! Deploying trigger feed GitHubWebhookTrigger ... Done! Deploying rule helloworldOnWebhook ... Done! Deployment completed successfully.<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <strong>hello world<\/strong>, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u0443\u044e \u0438\u0437 GitHub \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 GitHub, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e webhook:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ue\/wu\/u8\/uewuu8tbcwul0xw5bk6q5dosqcu.png\"><\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043d\u043e\u0432\u044b\u0435 \u043f\u0440\u0430\u0432\u043a\u0438 \u043a\u043e\u0434\u0430 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 GitHub. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0443\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u043a\u043e\u0434\u0430, \u043f\u0440\u0438\u0441\u044b\u043b\u0430\u0435\u043c\u0443\u044e \u043e\u0442 GitHub \u0447\u0435\u0440\u0435\u0437 POST \u0437\u0430\u043f\u0440\u043e\u0441. \u042d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">function main(params) {     console.log(\"GitHub repository is at \", params.repository.url);     return {commits: params.commits}; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u0438 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0440\u0430\u0432\u043a\u0435 README.md:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">\"commits\" : [   {     \"author\" : {       \"name\" : Priti Desai,       \"username\" : pritidesai     },     \"timestamp\" : 2017-03-20T12:54:41-07:00,     \"removed\" : [     ],     \"modified\" : [       README.md     ],     \"added\" : [     ],     \"message\" : Update README.md,     \"committer\" : {       \"name\" : GitHub,       \"email\" : noreply@github.com,       \"username\" : web-flow     }   } ],<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f GitHub webhook <a href=\"https:\/\/github.com\/apache\/incubator-openwhisk-wskdeploy\/tree\/master\/tests\/usecases\/github\">\u0442\u0443\u0442<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"signaly\">\u0421\u0438\u0433\u043d\u0430\u043b\u044b<\/h2>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u0438 OpenWhisk \u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u043c\u0443 \u0441\u0438\u0433\u043d\u0430\u043b\u0443 (\u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u0437\u0430\u0434\u0430\u0447 cron). \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0441\u043b\u043e\u0432\u043d\u043e\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u043e \u0441\u0438\u0433\u043d\u0430\u043b\u0443 \u0447\u0435\u0440\u0435\u0437 <code>wskdeploy<\/code>.<\/p>\n<p>  <\/p>\n<h3 id=\"shag-pervyy-1\">\u0428\u0430\u0433 \u043f\u0435\u0440\u0432\u044b\u0439<\/h3>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0441\u043e\u0431\u044b\u0442\u0438\u0439 <code>\/whisk.system\/alarms\/alarm<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0434\u043b\u044f \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0432 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">packages:     helloworld:         actions:             helloworld:                 location: src\/hello.js                 runtime: nodejs:6                 inputs:                     name:                         type: string                         description: name of a person                     place:                         type: string                         description: location of a person                 outputs:                     payload:                         type: string                         description: a simple greeting message, Hello World!         triggers:             Every12Hours:                 feed: \/whisk.system\/alarms\/alarm         rules:             hellowroldOnCron:                 action: helloworld                 trigger: Every12Hours<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-vtoroy-1\">\u0428\u0430\u0433 \u0432\u0442\u043e\u0440\u043e\u0439<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c cron \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <strong>Every12Hours<\/strong>. \u041c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u0432 cron, \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0438 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u043d\u044b\u0439:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">&lt;Minute&gt; &lt;Hour&gt; &lt;Day_of_the_Month&gt; &lt;Month_of_the_Year&gt; &lt;Day_of_the_Week&gt; \u0438\u043b\u0438 &lt;Minute&gt; &lt;Hour&gt; &lt;Day_of_the_Month&gt; &lt;Month_of_the_Year&gt; &lt;Day_of_the_Week&gt; &lt;Year&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0430\u0439\u043b\u0430 deployment.yaml:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">application:     name: SampleHelloWorld     namespace: _     packages:         helloworld:             actions:                 helloworld:                     inputs:                         name: Amy                         place: Paris             triggers:                 Every12Hours:                     inputs:                         cron: \"0 *\/12 * * *\"<\/code><\/pre>\n<p>  <\/p>\n<p>\u0415\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u0443\u044e \u043f\u0440\u0438 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 (\u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0438) \u0432 \u0432\u0438\u0434\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <strong>trigger_payload<\/strong>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">application:     name: SampleHelloWorld     namespace: _     packages:         helloworld:             actions:                 helloworld:                     inputs:                         name: Amy                         place: Paris             triggers:                 Every12Hours:                     inputs:                         cron: \"0 *\/12 * * * *\"                         trigger_payload: \"{\\\"name\\\":\\\"Mark\\\", \\\"place\\\":\\\"Barcelona\\\"}\"<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-tretiy-1\">\u0428\u0430\u0433 \u0442\u0440\u0435\u0442\u0438\u0439<\/h3>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">.\/wskdeploy -p ~\/SampleHelloWorldApp\/          ____      ___                   _    _ _     _     _         \/\\   \\    \/ _ \\ _ __   ___ _ __ | |  | | |__ (_)___| | __    \/\\  \/__\\   \\  | | | | '_ \\ \/ _ \\ '_ \\| |  | | '_ \\| \/ __| |\/ \/   \/  \\____ \\  \/  | |_| | |_) |  __\/ | | | |\/\\| | | | | \\__ \\   &lt;   \\   \\  \/  \\\/    \\___\/| .__\/ \\___|_| |_|__\/\\__|_| |_|_|___\/_|\\_\\    \\___\\\/              |_|  Packages: Name: helloworld     bindings:   * action: helloworld     bindings:         - name: name value: Amy         - name: place value: Paris  Triggers: * trigger: Every12Hours     bindings:         - name: cron value: 0 *\/12 * * * *     annotations:         - name: feed value: \/whisk.system\/alarms\/alarm   Rules * rule: helloworldEvery12Hours     - trigger: Every12Hours     - action: helloworld  Do you really want to deploy this? (y\/N): y Deploying package helloworld ... Done! Deploying action helloworld\/helloworld ... Done! Deploying trigger feed Every12Hours ... Done! Deploying rule helloworldEvery12Hours ... Done!  Deployment completed successfully.<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u0443 \u0430\u0441 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <strong>hello world<\/strong>, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0430\u044f \u043a\u0430\u0436\u0434\u044b\u0435 12 \u0447\u0430\u0441\u043e\u0432. \u041c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0435\u0435 \u043f\u0443\u0442\u0435\u043c \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477336\/\">\u0440\u0430\u043d\u0435\u0435<\/a><\/p>\n<p>  <\/p>\n<h2 id=\"paket-dlya-slack\">\u041f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f Slack<\/h2>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 <a href=\"https:\/\/slack.com\">Slack<\/a> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f <a href=\"https:\/\/github.com\/apache\/incubator-openwhisk-catalog\/tree\/master\/packages\/slack\">\u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f Slack<\/a>. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043f\u0430\u043a\u0435\u0442\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <code>wskdeploy<\/code>.<\/p>\n<p>  <\/p>\n<h3 id=\"shag-pervyy-2\">\u0428\u0430\u0433 \u043f\u0435\u0440\u0432\u044b\u0439<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b-\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0441 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u043e\u0439 \u043f\u0430\u043a\u0435\u0442\u0430 \u0434\u043b\u044f Slack. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0437\u0430\u0434\u0430\u0432\u0430\u044f \u0432 location \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <code>\/whisk.system\/slack<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">packages:     SlackPackage:         dependencies:             slack-package-to-post-messages:                 location: \/whisk.system\/slack                 inputs:                     username: $SLACK_USERNAME                     url: $SLACK_URL                     channel: $SLACK_CHANNEL<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0430\u0434\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0434\u043b\u044f <a href=\"https:\/\/my.slack.com\/services\/new\/incoming-webhook\/\">\u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e webhook<\/a> \u0432 \u043d\u0430\u0448\u0435\u043c \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 Slack. \u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 webhook \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u043a\u0430\u043d\u0430\u043b Slack \u043c\u043e\u0436\u043d\u043e \u043f\u043e <a href=\"https:\/\/github.com\/apache\/incubator-openwhisk-GitHubSlackBot\/blob\/master\/docs\/add-webhook-to-slack.md\">\u044d\u0442\u043e\u0439 \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438<\/a>.<\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u043a\u0435\u0442 \u0434\u043b\u044f Slack \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 \u043a\u0430\u043d\u0430\u043b Slack \u043a\u0430\u0436\u0434\u044b\u0439 \u0447\u0430\u0441 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0430\u043a\u043e\u0433\u043e \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">packages:     SlackPackage:         dependencies:             slack-package-to-post-messages:                 location: \/whisk.system\/slack                 inputs:                     username: $SLACK_USERNAME                     url: $SLACK_URL                     channel: $SLACK_CHANNEL         actions:             post-to-slack:                 function: actions\/post-to-slack.js                 runtime: nodejs:6                 inputs:                     message:                         type: string                         description: message to post on slack                     slack_package:                         type: string                         description: slack package name         triggers:             everyhour:                 feed: \/whisk.system\/alarms\/alarm         rules:             post-to-slack-every-hour:                 action: post-to-slack                 trigger: everyhour<\/code><\/pre>\n<p>  <\/p>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 post-to-slack.js \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/raw.githubusercontent.com\/apache\/openwhisk-wskdeploy\/master\/tests\/usecases\/slack\/actions\/post-to-slack.js\">\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <\/p>\n<h3 id=\"shag-vtoroy-2\">\u0428\u0430\u0433 \u0432\u0442\u043e\u0440\u043e\u0439<\/h3>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">application:     name: AppToPostToSlack     packages:         SlackPackage:             actions:                 post-to-slack:                     inputs:                         message: \"Hello from WskDeploy!\"                         slack_package: slack-package-to-post-messages             triggers:                 everyhour:                     inputs:                         cron: \"0 *\/1 * * *\"<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"shag-tretiy-2\">\u0428\u0430\u0433 \u0442\u0440\u0435\u0442\u0438\u0439<\/h3>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">.\/wskdeploy -p ~\/AppToPostToSlack\/          ____      ___                   _    _ _     _     _         \/\\   \\    \/ _ \\ _ __   ___ _ __ | |  | | |__ (_)___| | __    \/\\  \/__\\   \\  | | | | '_ \\ \/ _ \\ '_ \\| |  | | '_ \\| \/ __| |\/ \/   \/  \\____ \\  \/  | |_| | |_) |  __\/ | | | |\/\\| | | | | \\__ \\   &lt;   \\   \\  \/  \\\/    \\___\/| .__\/ \\___|_| |_|__\/\\__|_| |_|_|___\/_|\\_\\    \\ __\\\/              |_| Packages: Name: SlackPackage     bindings:   * dependency: slack-package-to-post-messages     location: \/whisk.system\/slack   * action: post-to-slack   bindings:     - message : \"Hello from WskDeploy!\"     - slack_package : \"slack-package-to-post-messages\"   annotations: Triggers: * trigger: everyhour     bindings:         - cron : \"0 *\/1 * * *\"     annotations:         - name: feed value: \/whisk.system\/alarms\/alarm Rules * rule: post-to-slack-every-hour     - trigger: everyhour     - action: SlackPackage\/post-to-slack Do you really want to deploy this? (y\/N): y Deployment completed successfully.<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435 \u0443 \u043d\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f post-to-slack, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u0430\u044f 1 \u0440\u0430\u0437 \u0437\u0430 \u0447\u0430\u0441. \u041c\u043e\u0436\u043d\u043e \u0435\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0443\u0442\u0435\u043c \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u044f, \u043a\u0430\u043a \u044d\u0442\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477336\/\">\u0440\u0430\u043d\u0435\u0435<\/a>. \u041f\u043e\u0441\u043b\u0435 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u0430\u043d\u0430\u043b\u0435 Slack:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">Activation: post-to-slack (9909dd5229e84526bff9902a2cd860df) [     \"2017-09-12T23:05:17.17872899Z  stdout: Hello from WskDeploy!\",     \"2017-09-12T23:05:17.549177677Z stdout: Posted message to slack\" ]<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"drugie-stati-cikla\">\u0414\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0430\u0442\u044c\u0438 \u0446\u0438\u043a\u043b\u0430<\/h2>\n<p>  <\/p>\n<p><a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477336\/\">\u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk, \u0447\u0430\u0441\u0442\u044c 1<\/a><br \/>  <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477628\/\">\u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk, \u0447\u0430\u0441\u0442\u044c 2<\/a><br \/>  \u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk, \u0447\u0430\u0441\u0442\u044c 3<br \/>  \u0411\u0435\u0441\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 OpenWhisk, \u0447\u0430\u0441\u0442\u044c 4<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d() } } }t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>      <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477628\/\"> https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477628\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/477628\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yk\/jd\/cb\/ykjdcbuozxj70sxwrtxebx0l6u8.png\"><\/p>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0446\u0438\u043a\u043b \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u043d\u044b\u0445 \u0437\u0430\u043c\u0435\u0442\u043e\u043a \u043e\u0431 OpenWhisk \u043e\u0442 \u0430\u0432\u0442\u043e\u0440\u0430 <a href=\"https:\/\/medium.com\/@pdesai8\">Priti Desai<\/a>. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f GitHub webhook, \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0435\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0432 Slack.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-295246","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295246","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=295246"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/295246\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=295246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=295246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=295246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}