{"id":3200,"date":"2013-10-15T08:01:45","date_gmt":"2013-10-14T23:01:45","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=3200"},"modified":"2018-11-14T16:33:53","modified_gmt":"2018-11-14T07:33:53","slug":"openshift-online-jenkins-bitbucket","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2013\/10\/15\/openshift-online-jenkins-bitbucket\/","title":{"rendered":"OpenShift \u306e jenkins \u3068 bitbucket \u3092\u9023\u643a"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u5317\u5ddd\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u524d\u304b\u3089\u6c17\u306b\u306a\u3063\u3066\u3044\u305f\u3001OpenShift Online \u3092\u4f7f\u3063\u3066jenkins\u3092\u69cb\u7bc9\u3057\u307e\u3057\u305f\u3002<br \/>\n\u305b\u3063\u304b\u304f\u306a\u306e\u3067bitbucket\u3068\u9023\u643a\u3057\u3066\u307f\u307e\u3057\u305f\u306e\u3067\u9023\u643a\u306e\u65b9\u6cd5\u3092\u66f8\u3044\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<h2>What's OpenShift?<\/h2>\n<p>OpenShift Online \u306f\u3001RedHat \u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b PaaS \u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3067\u3059\u3002<br \/>\n\u307e\u305f\u3001OpenShift Origin \u3068\u3057\u3066 PaaS \u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3092\u69cb\u7bc9\u3057\u3066\u3044\u308b\u30bd\u30d5\u30c8\u30a6\u30a8\u30a2\u304c\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u30bd\u30d5\u30c8\u30a6\u30a8\u30a2\u3068\u3057\u3066\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a title=\"openshift\" href=\"https:\/\/www.openshift.com\/\" target=\"_blank\">https:\/\/www.openshift.com\/<\/a><\/p>\n<h2>Create Account &amp; Instant App Jenkins Server<\/h2>\n<p>OpenShift \u3067 Jenkins Server\u3092\u69cb\u7bc9\u3059\u308b\u306e\u306f\u975e\u5e38\u306b\u7c21\u5358\u3067\u3059\u3002<br \/>\nWEB\u30da\u30fc\u30b8\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u901a\u308a\u306b\u3059\u308c\u3070\u3001WEB\u4e0a\u304b\u3089\u307b\u3093\u306e15\u5206\u3067\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002<br \/>\n\u305d\u306e\u305f\u3081\u3001OpenShift \u4e0a\u306b Jenkins Server\u3092\u69cb\u7bc9\u3059\u308b\u624b\u9806\u306f\u3042\u307e\u308a\u8a73\u3057\u304f\u8a18\u8f09\u3057\u307e\u305b\u3093\u3002<\/p>\n<h3>1.\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u308b<\/h3>\n<p style=\"padding-left: 30px;\">OpenShift \u306eTOP\u30da\u30fc\u30b8 ONLIEN Public PaaS \u306e SIGN UP For Free \u304b\u3089\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>2.Jenkins Server\u3092\u69cb\u7bc9<\/h3>\n<p style=\"padding-left: 30px;\">Jenkins Server\u306e\u69cb\u7bc9\u306f\u3001\u30b5\u30a4\u30f3\u30a2\u30c3\u30d7\u5f8c\u3001Create Application \u306e\u30da\u30fc\u30b8\u304b\u3089 Jenkins Server\u3092\u9078\u629e\u3057\u3001\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u901a\u308a\u306b\u9032\u3081\u3070\u69cb\u7bc9\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<h2>jenkins\u3068bitbucket\u3092\u9023\u643a<\/h2>\n<p>\u81ea\u5206\u306e\u30b5\u30fc\u30d0\u4e0a\u306e Jenkins \u3067\u3042\u308c\u3070\u3001$HOME\/.ssh\/config \u306b\u516c\u958b\u9375\u8a8d\u8a3c\u306e\u305f\u3081\u306e\u60c5\u5831\u3092\u8a18\u8f09<br \/>\n\u3057\u3066\u3084\u308c\u3070\u3088\u3044\u3067\u3059\u304c\u3001OpenShift Online \u306e\u5834\u5408\u306f\u3001$HOME\/.ssh\/config \u306b\u6a29\u9650\u304c\u306a\u3044\u305f\u3081<br \/>\n\u5909\u66f4\u304c\u3067\u304d\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\u3001GIT_SSH \u3092\u5229\u7528\u3057\u3066\u9023\u643a\u3057\u307e\u3059\u3002<\/p>\n<p>GIT_SSH \u306b\u95a2\u3057\u3066\u306f\u524d\u56de\u8a18\u4e8b\u3092\u66f8\u304d\u307e\u3057\u305f\u306e\u3067\u3054\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u300c<a title=\"GIT_SSH \u3092\u5229\u7528\u3057\u3066bitbucket\u304b\u3089\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\" href=\"http:\/\/www.techscore.com\/blog\/2013\/09\/26\/git_ssh-%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%81%A6bitbucket%E3%81%8B%E3%82%89%E3%83%81%E3%82%A7%E3%83%83%E3%82%AF%E3%82%A2%E3%82%A6%E3%83%88\/\" target=\"_blank\">GIT_SSH \u3092\u5229\u7528\u3057\u3066bitbucket\u304b\u3089\u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8<\/a>\u300d<\/p>\n<h3>1.OpenShift \u30b5\u30fc\u30d0\u306b\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/h3>\n<p style=\"padding-left: 30px;\">Web\u30da\u30fc\u30b8\u304b\u3089\u516c\u958b\u9375\u3092\u767b\u9332\u3057OpenShift Server\u306b ssh \u63a5\u7d9a\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p style=\"padding-left: 30px;\">Settings -&gt; Public Keys \u306e Paste the contents of your public key file (.pub)<br \/>\n\u304b\u3089\u516c\u958b\u9375\u304c\u767b\u9332\u3067\u304d\u307e\u3059\u306e\u3067\u767b\u9332\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p style=\"padding-left: 30px;\">\u767b\u9332\u304c\u3067\u304d\u305f\u3089\u3001My Applications \u304b\u3089 \u4f5c\u6210\u3057\u305f Jenkins Server \u3092\u9078\u629e\u3057ssh \u63a5\u7d9a\u306e\u305f\u3081\u306e<br \/>\n\u60c5\u5831\u3092\u53d6\u5f97\u3057\u5148\u307b\u3069\u767b\u9332\u3057\u305f\u516c\u958b\u9375\u306e\u30da\u30a2\u3068\u306a\u308b\u79d8\u5bc6\u9375\u3092\u5229\u7528\u3057\u3066 ssh \u3067\u63a5\u7d9a\u3059\u308c\u3070<br \/>\n\u4f5c\u6210\u3057\u305f Jenkins Server \u306b\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u307e\u3059\u3002<\/p>\n<p style=\"padding-left: 30px;\">\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3053\u3093\u306a\u611f\u3058<\/p>\n<pre class=\"lang:sh decode:true\" style=\"padding-left: 30px;\">$ ls -l\r\ndrwxr-xr-x. 4 root                     52414e90e0b8cd1c6a0001bc 4096 Sep 24 04:34 app-root\r\ndrwxr-xr-x. 3 root                     root                     4096 Sep 24 04:34 git\r\ndrwxr-xr-x. 8 52414e90e0b8cd1c6a0001bc 52414e90e0b8cd1c6a0001bc 4096 Sep 24 04:34 jenkins<\/pre>\n<p style=\"padding-left: 30px;\">.ssh \u306b\u306f\u6a29\u9650\u304c\u3042\u308a\u307e\u305b\u3093<\/p>\n<pre class=\"lang:sh decode:true\" style=\"padding-left: 30px;\">drwxr-x---.   2 root                     52414e90e0b8cd1c6a0001bc  4096 Sep 24 04:35 .ssh<\/pre>\n<h3>2. bitbucket\u306b\u516c\u958b\u9375\u8a8d\u8a3c\u306e\u305f\u3081\u306b\u516c\u958b\u9375\u3092\u767b\u9332<\/h3>\n<p style=\"padding-left: 30px;\">$HOME\/app-root\/data\/.ssh \u306b\u516c\u958b\u9375\u3068\u79d8\u5bc6\u9375\u306e\u30da\u30a2\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u4eca\u56de\u306f\u3053\u306e\u30da\u30a2\u3092\u516c\u958b\u9375\u8a8d\u8a3c\u306b\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\" style=\"padding-left: 30px;\">cat app-root\/data\/.ssh\/jenkins_id_rsa.pub<\/pre>\n<p style=\"padding-left: 30px;\">\u307e\u305f\u3001\u79d8\u5bc6\u9375\u306e\u6a29\u9650\u304c 600 \u3067\u306a\u3044\u306e\u3067\u5909\u66f4\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">chmod 600 app-root\/data\/.ssh\/jenkins_id_rsa<\/pre>\n<p style=\"padding-left: 30px;\">bitbucket\u3067\u3000\u516c\u958b\u9375\u3092\u767b\u9332\u3059\u308b\u306b\u306f\u3001bitbucket\u306b\u30ed\u30b0\u30a4\u30f3 -&gt; \u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u7ba1\u7406 -&gt; SSH \u30ad\u30fc -&gt; \u9375\u3092\u8ffd\u52a0\u3067\u8ffd\u52a0\u53ef\u80fd\u3067\u3059\u306e\u3067\u516c\u958b\u9375\u306e\u767b\u9332\u304c\u3067\u304d\u307e\u3059\u306e\u3067\u767b\u9332\u3092\u3057\u3066\u304a\u3044\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<h3>3. GIT_SSH \u306e\u305f\u3081\u306e\u30e9\u30c3\u30d1\u30fc\u3092\u4f5c\u6210<\/h3>\n<p style=\"padding-left: 30px;\">GIT_SSH\u306e\u305f\u3081\u306e\u30e9\u30c3\u30d1\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">vi app-root\/data\/gitssh.sh\r\n\u4e0b\u8a18\u3092\u8ffd\u52a0\r\n#! \/bin\/sh\r\nssh -o UserKnownHostsFile=\/dev\/null -o StrictHostKeyChecking=no -i $OPENSHIFT_DATA_DIR\/.ssh\/jenkins_id_rsa \"$@\"<\/pre>\n<p style=\"padding-left: 30px;\">\u6a29\u9650\u3082\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:sh decode:true\">chmod u+x app-root\/data\/gitssh.sh<\/pre>\n<h3>5. Jenkins GIT_SSH \u74b0\u5883\u5909\u6570\u3092\u8a2d\u5b9a<\/h3>\n<p style=\"padding-left: 30px;\">Jenkins \u304b\u3089 GIT_SSH \u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306b\u306f\u74b0\u5883\u5909\u6570\u306b\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nJenkins\u306e\u7ba1\u7406 -&gt; \u30b7\u30b9\u30c6\u30e0\u8a2d\u5b9a -&gt; Global properties \u74b0\u5883\u5909\u6570 \u3067\u8a2d\u5b9a\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<h3>6. \u30d3\u30eb\u30c9\u3092\u5b9f\u884c<\/h3>\n<p style=\"padding-left: 30px;\">\u3044\u3064\u3082\u901a\u308a\u306b Jenkins \u306e Git Repositories \u306b \u8a2d\u5b9a\u3057\u3066\u3084\u308c\u3070\u3000bitbucket \u304b\u3089 \u30c1\u30a7\u30c3\u30af\u30a2\u30a6\u30c8\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u306a\u304c\u306a\u304c\u3068\u66f8\u304d\u307e\u3057\u305f\u304c\u3001\u30dd\u30a4\u30f3\u30c8\u306f\uff12\u3064\u3067\u3059\u3002<\/p>\n<p>1. OpenShift \u30b5\u30fc\u30d0\u3067\u306f\u3001UserHome \u306b\u6a29\u9650\u304c\u306a\u3044\u305f\u3081 GIT_SSH \u3092\u5229\u7528\u3057\u56de\u907f\u3059\u308b\u3002<br \/>\n2. GIT_SSH \u3092\u5229\u7528\u3059\u308b\u305f\u3081\u306bJenkins\u306e\u74b0\u5883\u5909\u6570\u306b\u6307\u5b9a\u3059\u308b\u3002<\/p>\n<p>\u5c11\u3057\u7656\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3042\u308b\u7a0b\u5ea6\u306e\u30ea\u30bd\u30fc\u30b9\u307e\u3067\u306f\u7121\u6599\u3067\u4f7f\u3048\u308b\u305f\u3081\u6d3b\u7528\u3057\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u5317\u5ddd\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u524d\u304b\u3089\u6c17\u306b\u306a\u3063\u3066\u3044\u305f\u3001OpenShift Online \u3092\u4f7f\u3063\u3066jenkins\u3092\u69cb\u7bc9\u3057\u307e\u3057\u305f\u3002<br \/>\n\u305b\u3063\u304b\u304f\u306a\u306e\u3067bitbucket\u3068\u9023\u643a\u3057\u3066\u307f\u307e\u3057\u305f\u306e\u3067\u9023\u643a\u306e\u65b9\u6cd5\u3092\u66f8\u3044\u3066\u304a\u304d\u307e\u3059\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2013\/10\/15\/openshift-online-jenkins-bitbucket\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[110,112,111],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/3200"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=3200"}],"version-history":[{"count":1,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/3200\/revisions"}],"predecessor-version":[{"id":17905,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/3200\/revisions\/17905"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=3200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=3200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=3200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}