{"id":261538,"date":"2015-07-15T17:31:03","date_gmt":"2015-07-15T13:31:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=261538"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=261538","title":{"rendered":"\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 CloudFoundry\/IBM Bluemix buildpack \u0438\u043b\u0438 \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 Awk (gawk)"},"content":{"rendered":"<p>     \t<i>gawk \u2014 \u0433\u043b\u0430\u0437\u0435\u0442\u044c \u0440\u0430\u0437\u0438\u043d\u0443\u0432 \u0440\u043e\u0442, \u0442\u0430\u0440\u0430\u0449\u0438\u0442\u044c \u0433\u043b\u0430\u0437\u0430<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d47\/1ba\/d73\/d471bad737c54eb1b36484964272f13a.jpg\"\/><\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0448\u0443\u0442\u043e\u043a, \u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0448\u0443 \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Awk (Gawk) \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 IBM Bluemix.<\/p>\n<p>  CloudFoundry \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 <a href=\"http:\/\/bluemix.net\/\">IBM Bluemix<\/a> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 <a href=\"https:\/\/github.com\/cloudfoundry-community\/cf-docs-contrib\/wiki\/Buildpacks\">\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0445<\/a> \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u0435\u0431 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432. \u0412\u0441\u0435 \u044d\u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0431\u0438\u043b\u0434\u043f\u0430\u043a\u043e\u0432 (\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u043b\u043e\u0432\u0430 buildpack). \u0411\u0438\u043b\u0434\u043f\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u043e\u0437\u0434\u0430\u044e\u0442 \u0431\u0438\u043b\u0434\u043f\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0411\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u044f\u0437\u044b\u043a \u0438\u043b\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u044b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 OpenCV, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0442\u0440\u043d\u044b\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u044f\u0437\u044b\u043a\u0430 \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440\u043e\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (npm, pip, bundler). \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0431\u0438\u043b\u0434\u043f\u0430\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043d\u0443\u0436\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0431\u0438\u043b\u0434\u043f\u0430\u043a\u043e\u0432 \u043b\u0435\u0436\u0430\u0442 \u043d\u0430 github, \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043a, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0431\u043e\u043b\u0435\u0435 \u0440\u0435\u0434\u043a\u0438\u0439 \u2014 \u044f\u0437\u044b\u043a \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0442.\u0435. \u0431\u0438\u043b\u0434\u043f\u0430\u043a \u043f\u043e\u043a\u0430 \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u043b. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0435\u0433\u043e \u0441 \u043d\u0443\u043b\u044f, \u0447\u0442\u043e \u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0447\u0443\u0442\u044c \u043d\u0438\u0436\u0435. \u042f \u0434\u043e\u043b\u0433\u043e \u0438\u0441\u043a\u0430\u043b \u043a\u0430\u043a\u043e\u0439 \u044f\u0437\u044b\u043a \u043f\u043e\u043a\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f CloudFoundry, \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 Brainfuck. \u041a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u044f \u0434\u043e\u043f\u0438\u0441\u0430\u043b \u0431\u0438\u043b\u0434\u043f\u0430\u043a, \u044f \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u044d\u0442\u043e\u043c \u044f\u0437\u044b\u043a\u0435 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041f\u043e\u0438\u0441\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043b, \u0447\u0442\u043e \u0438 \u0443 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u0447\u0443\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u0435\u0435 \u0432 \u0447\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 \u0431\u0438\u043b\u0434\u043f\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0441\u0440\u0435\u0434\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u0442\u0435\u043c \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0435\u043c\u0443 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u0440\u0442 \u0438 \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430, \u0433\u0434\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c HTTP \u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u0422.\u0435. \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e hello world \u043c\u0430\u043b\u043e. \u042f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b \u043f\u043e\u0438\u0441\u043a\u0438 \u0438 \u043d\u0430\u0448\u0435\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u043d\u0430 <a href=\"http:\/\/www.pugo.org:8080\">PostScript<\/a> \u0438 <a href=\"http:\/\/awk.info\/?tools\/server\">Awk (\u0442\u043e\u0447\u043d\u0435\u0435 gawk)<\/a>. \u0412 \u0438\u0442\u043e\u0433\u0435 \u044f \u0432\u044b\u0431\u0440\u0430\u043b Awk \u0438 \u043d\u0430\u0447\u0430\u043b \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0431\u0438\u043b\u0434\u043f\u0430\u043a.<\/p>\n<p>  <a href=\"http:\/\/docs.cloudfoundry.org\/buildpacks\/custom.html\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/a> \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0449\u0438\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438, \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0431\u0438\u043b\u0434\u043f\u0430\u043a\u0438. \u0412 \u0441\u0430\u043c\u043e\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0430\u043f\u043a\u0443 bin \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u043d\u0435\u0435 3 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u043c\u044b\u0445 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<p>  <b>detect<\/b> \u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u0431\u0438\u043b\u0434\u043f\u0430\u043a \u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u0415\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u0435\u0440\u043d\u0443\u0442\u044c 0 \u0438 \u043d\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u0438\u043c\u044f \u044f\u0437\u044b\u043a\u0430 \u0438\u043b\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 app.awk \u0432 \u043a\u043e\u0440\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u0432\u0435\u0434\u0435\u043c \u0442\u0430\u043a\u043e\u0435 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435.<\/p>\n<pre><code>#!\/usr\/bin\/env bash # bin\/detect &lt;build-dir&gt;  # Any awk web app must have app.awk file if [ -f $1\/app.awk ]; then   echo &quot;gawk&quot;   exit 0 fi  exit 1  <\/code><\/pre>\n<p>  <b>compile <\/b> \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u0441\u0442\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0434\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c gawk. \u0427\u0442\u043e\u0431\u044b \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0435\u0433\u043e \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Ubuntu \u0438 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0443\u044e \u043d\u0430 \u044d\u0442\u043e\u043c \u0448\u0430\u0433\u0435. \u041d\u043e \u0441\u0431\u043e\u0440\u043a\u0430 gawk \u043d\u0435 \u0442\u0430\u043a\u043e\u0439 \u0437\u0430\u0442\u0440\u0430\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u044d\u0448, \u0442\u0430\u043a \u0447\u0442\u043e \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u043e\u0434\u0438\u043d \u0440\u0430\u0437. \u0417\u0430\u0442\u043e \u043c\u044b \u0442\u043e\u0447\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0444\u0430\u0439\u043b, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434 \u043d\u0443\u0436\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u041e\u0421 \u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443.<\/p>\n<pre><code>#!\/usr\/bin\/env bash # bin\/compile &lt;build-dir&gt; &lt;cache-dir&gt;  set -e  build_dir=$1 cache_dir=$2  awk_cache=$cache_dir\/gawk-4.1.3 awk_url=&quot;http:\/\/ftp.gnu.org\/gnu\/gawk\/gawk-4.1.3.tar.gz&quot;  if [ -f $awk_cache\/gawk ]; then     echo &quot;Using cached gawk&quot; else     # download and compile gawk     mkdir -p $awk_cache     curl -o $cache_dir\/gawk.tar.gz &quot;$awk_url&quot;     cd $cache_dir     tar zxvf  gawk.tar.gz      cd $awk_cache     .\/configure     make fi  # copy gawk to build dir cp $awk_cache\/gawk $build_dir   # set path and test gawk PATH=$build_dir:$PATH gawk -V  # create a launcher to wrap env vars passing echo &quot;#!\/usr\/bin\/env bash\\n&quot; &gt; $build_dir\/awk-start echo &quot;\/app\/gawk -v PORT=\\&quot;\\$PORT\\&quot; -v HOST=\\&quot;\\$VCAP_APP_HOST\\&quot; -f \\$1&quot; &gt;&gt; $build_dir\/awk-start chmod +x $build_dir\/awk-start <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u2014 \u043c\u0435\u0441\u0442\u043e \u0441\u0431\u043e\u0440\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 (build_dir), \u0432\u0442\u043e\u0440\u043e\u0439 \u2014 \u043a\u044d\u0448. \u041d\u0430\u0448\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0444\u0430\u0439\u043b\u044b \u0432 build_dir, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435\u0442 \u044d\u0442\u043e gawk. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, Awk \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439 \u043f\u043e\u0440\u0442 \u043d\u0430\u043c \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 CloudFoundry \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f PORT). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043e\u0431\u0435\u0440\u0442\u043a\u0443 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430.<\/p>\n<p>  <b> release<\/b> \u2014 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u044d\u0442\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0447\u0442\u043e \u043e\u0431\u044b\u0447\u043d\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u0430\u0439\u043b\u0435 Procfile.<\/p>\n<pre><code>#!\/usr\/bin\/env bash # bin\/release &lt;build-dir&gt;  cat &lt;&lt;EOF config_vars:     PATH: \/app:$PATH default_process_types:     web: \/app\/awk-start app.awk EOF  <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u043f\u043e\u0442\u043e\u043c \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u043d\u0430 github, \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 <a href=\"https:\/\/github.com\/hashmap\/gawk-buildpack\">https:\/\/github.com\/hashmap\/gawk-buildpack<\/a><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0438\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0430\u043f\u043a\u0443 gawktest, \u0432 \u043d\u0435\u0439 \u0444\u0430\u0439\u043b app.awk<\/p>\n<pre><code># A Web Server in Awk # a simple, single user, web server built with gawk. # based on code form http:\/\/awk.info\/?tools\/server by Michael Sanders  BEGIN {    host     = &quot;\/inet\/tcp\/&quot; PORT &quot;\/0\/0&quot;  # host string    status   = 200                       # 200 == OK    reason   = &quot;OK&quot;                      # server response    RS = ORS = &quot;\\r\\n&quot;                    # header line terminators    doc      = Setup()                   # html document    len      = length(doc) + length(ORS) # length of document    print &quot;Staring AWK server&quot;   while (1) {       print &quot;HTTP\/1.0&quot;, status, reason |& host       print &quot;Connection: Close&quot;        |& host       print &quot;Pragma: no-cache&quot;         |& host       print &quot;Content-length:&quot;, len     |& host       print ORS doc                    |& host       close(host)     # close client connection       host |& getline # wait for new client request    }  }   function Setup() {    tmp = &quot;&lt;html&gt;\\   &lt;head&gt;&lt;title&gt;Simple gawk server&lt;\/title&gt;&lt;\/head&gt;\\   &lt;body&gt;\\   Hello from awk!\\   &lt;\/body&gt;\\   &lt;\/html&gt;&quot;    return tmp  }  <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e:<\/p>\n<pre><code> gawk -v PORT=8080 -f app.awk  <\/code><\/pre>\n<p>  \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430 Bluemix, \u0434\u0435\u043b\u0430\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 cf push, \u043d\u043e \u0435\u0449\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u0438\u043b\u0434\u043f\u0430\u043a\u0430:<\/p>\n<pre><code>gawktest  cf push gawktest -b https:\/\/github.com\/hashmap\/gawk-buildpack Updating app gawktest in org xxx@gmail.com \/ space dev as xxx@gmail.com... OK  Uploading gawktest... Uploading app files from: \/Users\/alex\/projects\/gawktest Uploading 32.3K, 3 files Done uploading OK  Stopping app gawktest in org xxx@gmail.com \/ space dev as xxx@gmail.com... OK  Starting app gawktest in org xxx@gmail.com \/ space dev as xxx@gmail.com... -----&gt; Downloaded app package (8.0K) -----&gt; Downloaded app buildpack cache (11M) Cloning into '\/tmp\/buildpacks\/gawk-buildpack'... Using cached gawk GNU Awk 4.1.3, API: 1.1 Copyright (C) 1989, 1991-2015 Free Software Foundation. This program is free software; you can redistribute it and\/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http:\/\/www.gnu.org\/licenses\/. -----&gt; Uploading droplet (724K)  1 of 1 instances running  App started   OK  App gawktest was started using this command `\/app\/awk-start app.awk`  Showing health and status for app gawktest in org xxx@gmail.com \/ space dev as xxx@gmail.com... OK  requested state: started instances: 1\/1 usage: 64M x 1 instances urls: gawktest.mybluemix.net last uploaded: Wed Jul 15 12:21:13 UTC 2015 stack: lucid64 buildpack: https:\/\/github.com\/hashmap\/gawk-buildpack       state     since                    cpu    memory        disk         details #0   running   2015-07-15 03:22:08 PM   0.0%   1.1M of 64M   1.9M of 1G <\/code><\/pre>\n<p>  \u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438 <a href=\"http:\/\/gawktest.mybluemix.net\">\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e<\/a>, \u043f\u043e\u043a\u0430 \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0434\u043d\u043e\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439. \u0422.\u043a. \u044d\u0442\u043e \u043d\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a, \u0442\u043e \u0443\u0436\u0435 \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0439 gawk \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0438\u0437 \u043a\u044d\u0448\u0430. \u041f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043a\u0430\u043a \u043e\u043d \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f. \u0422\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u044f gawk \u0438 \u0435\u0433\u043e \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u044f.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u043a\u0442\u043e \u043d\u0430\u043f\u0438\u0448\u0435\u0442 \u0432\u0435\u0431 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043d\u0430 Brainfuck \u2014 \u0434\u0430\u0439\u0442\u0435 \u0437\u043d\u0430\u0442\u044c.     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/262701\/\"> http:\/\/habrahabr.ru\/post\/262701\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t<i>gawk \u2014 \u0433\u043b\u0430\u0437\u0435\u0442\u044c \u0440\u0430\u0437\u0438\u043d\u0443\u0432 \u0440\u043e\u0442, \u0442\u0430\u0440\u0430\u0449\u0438\u0442\u044c \u0433\u043b\u0430\u0437\u0430<\/i><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d47\/1ba\/d73\/d471bad737c54eb1b36484964272f13a.jpg\"\/><\/p>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0448\u0443\u0442\u043e\u043a, \u044f \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u043f\u0438\u0448\u0443 \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Awk (Gawk) \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 IBM Bluemix.<\/p>\n<p>  CloudFoundry \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 <a href=\"http:\/\/bluemix.net\/\">IBM Bluemix<\/a> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 <a href=\"https:\/\/github.com\/cloudfoundry-community\/cf-docs-contrib\/wiki\/Buildpacks\">\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u044b\u0445<\/a> \u044f\u0437\u044b\u043a\u043e\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u0435\u0431 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432. \u0412\u0441\u0435 \u044d\u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0435 \u0431\u0438\u043b\u0434\u043f\u0430\u043a\u043e\u0432 (\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u043b\u043e\u0432\u0430 buildpack). \u0411\u0438\u043b\u0434\u043f\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043f\u043b\u0430\u0433\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0440\u0435\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0421\u043e\u0437\u0434\u0430\u044e\u0442 \u0431\u0438\u043b\u0434\u043f\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e \u0432 \u0434\u0432\u0443\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445.  <\/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-261538","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/261538","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=261538"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/261538\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=261538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=261538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=261538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}