{"id":558,"date":"2020-04-12T17:15:04","date_gmt":"2020-04-12T08:15:04","guid":{"rendered":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=558"},"modified":"2020-04-12T19:06:49","modified_gmt":"2020-04-12T10:06:49","slug":"jenkins-github-%ec%97%b0%eb%8f%992-2","status":"publish","type":"post","link":"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=558","title":{"rendered":"Jenkins github \uc5f0\ub3d9(2\/2)"},"content":{"rendered":"<h1>Jenkins github \uc5f0\ub3d9(2\/2)<\/h1>\n<p><strong><a href=\"https:\/\/github.com\/skyer9\/TestCiCd\">https:\/\/github.com\/skyer9\/TestCiCd<\/a> \ub294 \ud14c\uc2a4\ud2b8 \ud6c4 \ud37c\ube14\ub9ad\uc73c\ub85c \ubcc0\uacbd\ud588\uc2b5\ub2c8\ub2e4.<\/strong><\/p>\n<h2>\ube4c\ub4dc \uc790\ub3d9\ud654<\/h2>\n<h3>GitHub Integration \ud50c\ub7ec\uadf8\uc778 \uc124\uce58<\/h3>\n<p><code>\uc820\ud0a8\uc2a4 \uba54\uc778\ud654\uba74<\/code> &gt; <code>Jenkins \uad00\ub9ac<\/code> &gt; <code>\ud50c\ub7ec\uadf8\uc778 \uad00\ub9ac<\/code> \uc5d0\uc11c, <code>Gradle<\/code> \uc744 \uac80\uc0c9\ud558\uc5ec \uc124\uce58\ud569\ub2c8\ub2e4.<\/p>\n<h3>Gradle \uc124\uc815<\/h3>\n<p>\ud504\ub85c\uc81d\ud2b8 \uad6c\uc131\uc73c\ub85c \uc774\ub3d9\ud558\uc5ec Project url \uc744 \uc124\uc815\ud569\ub2c8\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.skyer9.pe.kr\/wordpress\/wp-content\/uploads\/2020\/04\/20200412-15.png\" alt=\"\" \/><\/p>\n<p>\ube4c\ub4dc \ud0ed\uc744 \uc544\ub798\uc640 \uac19\uc774 \uc124\uc815\ud569\ub2c8\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.skyer9.pe.kr\/wordpress\/wp-content\/uploads\/2020\/04\/20200412-16.png\" alt=\"\" \/><\/p>\n<p>\uc124\uc815\uc774 \ub05d\ub098\uba74 \uc800\uc7a5\uc744 \ub20c\ub7ec\uc90d\ub2c8\ub2e4.<\/p>\n<h3>\ud655\uc778\ud558\uae30<\/h3>\n<p><code>Build Now<\/code> \ub97c \ub20c\ub7ec \uc815\uc0c1\uc801\uc73c\ub85c \ube4c\ub4dc\ub418\ub294\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4.<\/p>\n<h2>\ubc30\ud3ec \uc790\ub3d9\ud654<\/h2>\n<p>\ubc30\ud3ec\ub294 \uc820\ud0a8\uc2a4\uac00 \uc788\ub294 \uc11c\ubc84\uc5d0 \ubc30\ud3ec\ud558\ub294 \uac83\uc73c\ub85c \ubc30\ud3ec\ub2e8\uacc4\ub97c \ub2e8\uc21c\ud654 \ud569\ub2c8\ub2e4.<\/p>\n<p>\ub610\ud55c \ubc30\ud3ec\ub294 <code>docker<\/code> \ub97c \uc774\uc6a9\ud558\uae30\uc5d0, \ub3c4\ucee4\uac00 \uc124\uce58\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc73c\uba74 \uc124\uce58\ud574 \uc90d\ub2c8\ub2e4.<\/p>\n<h3>docker \uc124\uce58<\/h3>\n<pre><code class=\"language-bash\"># snap \uad00\ub828 \ubc84\uadf8\uac00 \uc788\ub294 \ub4ef\n# sudo snap install docker\n\nsudo apt-get update\n\nsudo apt-get install \\\n    apt-transport-https \\\n    ca-certificates \\\n    curl \\\n    gnupg-agent \\\n    software-properties-common\n\ncurl -fsSL https:\/\/download.docker.com\/linux\/ubuntu\/gpg | sudo apt-key add -\n\nsudo add-apt-repository \\\n   &quot;deb [arch=amd64] https:\/\/download.docker.com\/linux\/ubuntu \\\n   $(lsb_release -cs) \\\n   stable&quot;\n\nsudo apt-get update\nsudo apt-get install docker-ce docker-ce-cli containerd.io\n\n# \uc820\ud0a8\uc2a4\uc5d0 docker \uc2e4\ud589\uad8c\ud55c \ubd80\uc5ec\nsudo usermod -a -G docker jenkins\nsudo service docker restart\nsudo service jenkins restart<\/code><\/pre>\n<p>\ub9c8\uc9c0\ub9c9\uc73c\ub85c, \ubc30\ud3ec\ub2e8\uacc4\ub97c \ub2e8\uc21c\ud654 \ud558\uae30\uc704\ud574 \ubb34\uc911\ub2e8 \ubc30\ud3ec\ub294 \uace0\ub824\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>Dockerfile \ucd94\uac00<\/h3>\n<p>\ub9ac\ud3ec\uc9c0\ud130\ub9ac\uc5d0 <code>Dockerfile<\/code> \uc744 \ucd94\uac00\ud558\uace0 \uc544\ub798 \ub0b4\uc6a9\uc744 \ucd94\uac00\ud569\ub2c8\ub2e4.<\/p>\n<pre><code class=\"language-docker\"># Start with a base image containing Java runtime\n#FROM java:8\nFROM jenkins\/jenkins:jdk11\n\n# Add Author info\nLABEL maintainer=&quot;skyer9@gmail.com&quot;\n\n# Add a volume to \/tmp\nVOLUME \/tmp\n\n# Make port 8080 available to the world outside this container\nEXPOSE 8080\n\n# The application&#039;s jar file\nARG JAR_FILE=build\/libs\/TestCiCd-0.0.1-SNAPSHOT.jar\n\n# Add the application&#039;s jar to the container\nADD ${JAR_FILE} to-do-springboot.jar\n\n# Run the jar file\nENTRYPOINT [&quot;java&quot;,&quot;-Djava.security.egd=file:\/dev\/.\/urandom&quot;,&quot;-jar&quot;,&quot;\/to-do-springboot.jar&quot;]<\/code><\/pre>\n<h3>\ube4c\ub4dc \uc2a4\ud0ed \ucd94\uac00<\/h3>\n<p>\uc544\ub798\uc758 \uc774\ubbf8\uc9c0\uc640 \uac19\uc774 \uc2a4\ud0ed\uc744 \ucd94\uac00\ud558\uace0 \uc544\ub798 \uba85\ub839\uc744 \uc785\ub825\ud574\uc90d\ub2c8\ub2e4.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.skyer9.pe.kr\/wordpress\/wp-content\/uploads\/2020\/04\/20200412-17.png\" alt=\"\" \/><\/p>\n<pre><code class=\"language-bash\">docker build -t jenkins-docker-sample-app\/test .\ndocker ps -q --filter &quot;name=jenkins-docker&quot; | grep -q . &amp;&amp; docker stop jenkins-docker &amp;&amp; docker rm jenkins-docker || true\ndocker run -p 20000:8080 -d --name=jenkins-docker jenkins-docker-sample-app\/test\ndocker rmi -f $(docker images -f &quot;dangling=true&quot; -q) || true<\/code><\/pre>\n<h3>\ud655\uc778\ud558\uae30<\/h3>\n<p>github \uc5d0 \ucee4\ubc0b\uc744 \ud558\uba74 \ube4c\ub4dc \ubc0f \ubc30\ud3ec\uac00 \ubaa8\ub450 \uc790\ub3d9\uc73c\ub85c \uc9c4\ud589\ub429\ub2c8\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jenkins github \uc5f0\ub3d9(2\/2) https:\/\/github.com\/skyer9\/TestCiCd \ub294 \ud14c\uc2a4\ud2b8 \ud6c4 \ud37c\ube14\ub9ad\uc73c\ub85c \ubcc0\uacbd\ud588\uc2b5\ub2c8\ub2e4. \ube4c\ub4dc \uc790\ub3d9\ud654 GitHub Integration \ud50c\ub7ec\uadf8\uc778 \uc124\uce58 \uc820\ud0a8\uc2a4 \uba54\uc778\ud654\uba74 &gt; Jenkins \uad00\ub9ac &gt; \ud50c\ub7ec\uadf8\uc778 \uad00\ub9ac \uc5d0\uc11c, Gradle \uc744 \uac80\uc0c9\ud558\uc5ec \uc124\uce58\ud569\ub2c8\ub2e4. Gradle \uc124\uc815 \ud504\ub85c\uc81d\ud2b8 \uad6c\uc131\uc73c\ub85c \uc774\ub3d9\ud558\uc5ec Project url \uc744 \uc124\uc815\ud569\ub2c8\ub2e4. \ube4c\ub4dc \ud0ed\uc744 \uc544\ub798\uc640 \uac19\uc774 \uc124\uc815\ud569\ub2c8\ub2e4. \uc124\uc815\uc774 \ub05d\ub098\uba74 \uc800\uc7a5\uc744 \ub20c\ub7ec\uc90d\ub2c8\ub2e4. \ud655\uc778\ud558\uae30 Build Now \ub97c \ub20c\ub7ec \uc815\uc0c1\uc801\uc73c\ub85c \ube4c\ub4dc\ub418\ub294\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4. \ubc30\ud3ec\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.skyer9.pe.kr\/wordpress\/?p=558\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-558","post","type-post","status-publish","format-standard","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/558","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=558"}],"version-history":[{"count":8,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/558\/revisions"}],"predecessor-version":[{"id":574,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/558\/revisions\/574"}],"wp:attachment":[{"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skyer9.pe.kr\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}