[{"data":1,"prerenderedAt":607},["ShallowReactive",2],{"Categories":3,"NavIndexCategoriesCountFooter":203,"content-\u002F2014\u002F01\u002F20\u002Fdeploy-from-github-to-heroku-via-travis-ci\u002F":204},[4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,70,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202],{"category":5},"System Administration",{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},"Software Development",{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":27},{"category":27},{"category":67},"Drones & RC",{"category":69},"DIY Projects",{"category":67},{"category":72},"Photography",{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":67},{"category":67},{"category":72},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":5},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":67},{"category":67},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":72},{"category":67},{"category":138},"3D Printing - Laser Cutting - CNC",{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":5},{"category":138},{"category":27},{"category":27},{"category":138},{"category":138},{"category":72},{"category":158},"Photography,3D Printing - Laser Cutting - CNC",{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":67},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":181},"Home Assistant",{"category":181},{"category":72},{"category":27},{"category":27},{"category":72},{"category":138},{"category":5},{"category":72},{"category":72},{"category":138},{"category":27},{"category":181},{"category":181},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},191,{"id":205,"title":206,"body":207,"category":589,"date":590,"description":213,"embedImage":589,"extension":591,"image":589,"intro":589,"meta":592,"navigation":593,"path":594,"seo":595,"series":589,"sitemap":596,"stem":597,"tags":598,"__hash__":606},"content\u002F2014\u002F01\u002F20\u002Fdeploy-from-github-to-heroku-via-travis-ci.md","Deploy from github to heroku via travis-ci",{"type":208,"value":209,"toc":578},"minimark",[210,214,219,222,234,238,241,277,283,287,290,293,301,304,310,314,317,320,413,420,426,430,439,457,460,466,470,473,480,486,490,539,544,574],[211,212,213],"p",{},"A small test of using travis-ci to build a github project and auto deploy it to heroku.",[215,216,218],"h2",{"id":217},"step-1-a-webapp","Step 1 - A webapp",[211,220,221],{},"Create your webapp. For this I created a simple hello world webapp (1 jsp) with a dummy test (just to give travis-ci something to do).",[211,223,224],{},[225,226,233],"a",{"href":227,"rel":228,"target":232},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fweb-hello-world\u002Fcommit\u002F555edbd632b9b1ed920449c0c392887939176afb",[229,230,231],"nofollow","noopener","noreferer","_blank","Commit on github for this step",[215,235,237],{"id":236},"step-2-ci","Step 2 - CI",[211,239,240],{},"Let's add that to travis.",[242,243,244,254,257,260,263,266,274],"ul",{},[245,246,247,248,253],"li",{},"Head to ",[225,249,252],{"href":250,"rel":251,"target":232},"https:\u002F\u002Ftravis-ci.org\u002F",[229,230,231],"Travis"," and log in with github oauth.",[245,255,256],{},"Click on your logged in account name and choose Accounts",[245,258,259],{},"Hit the sync now button if the last sync isn't recent enough",[245,261,262],{},"Find your project and switch from off to on",[245,264,265],{},"Click the spanner (takes you to the deploy hooks for the github project), choose travis and enter your username\u002Ftoken (available from your travis profile)",[245,267,268,269],{},"Add travis config to the project. This means we need to add a .travis.yml file. This specifies the language as java and what JDK you want to use. See ",[225,270,273],{"href":271,"rel":272,"target":232},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fweb-hello-world\u002Fblob\u002Fmaster\u002F.travis.yml",[229,230,231],".travis.yml",[245,275,276],{},"The build should now appear in your list on travis",[211,278,279],{},[225,280,233],{"href":281,"rel":282,"target":232},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fweb-hello-world\u002Fcommit\u002F0456340bda81359e1602a43eff2eb0b9d14b99c0",[229,230,231],[215,284,286],{"id":285},"step-3-lets-get-the-build-status-to-show-at-github","Step 3 - Let's get the build status to show at github",[211,288,289],{},"Once your build passes - on the travis page you can see an icon - build passing. If you click on that you get a popup of build status links.",[211,291,292],{},"Grab the one that uses the same format you want to use for your README.",[211,294,295,296],{},"Create the README file if not already present and include the link to the image. For this test I used markdown ",[225,297,300],{"href":298,"rel":299,"target":232},"https:\u002F\u002Fraw.github.com\u002Fchrissearle\u002Fweb-hello-world\u002Fmaster\u002FREADME.md",[229,230,231],"README.md",[211,302,303],{},"Once pushed - refresh the github project page and you should see the build status icon.",[211,305,306],{},[225,307,233],{"href":308,"rel":309,"target":232},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fweb-hello-world\u002Fcommit\u002Fa3b7b0f494b912ba5a16d2e827c4fb7201fb8cfc",[229,230,231],[215,311,313],{"id":312},"step-4-create-heroku-app","Step 4 - Create heroku app",[211,315,316],{},"Heroku's example uses embedded jetty - so update the app",[211,318,319],{},"And initial deploy:",[321,322,327],"pre",{"className":323,"code":324,"language":325,"meta":326,"style":326},"language-shell shiki shiki-themes github-dark","$ heroku create web-hello-world\nCreating web-hello-world... done, stack is cedar\nhttp:\u002F\u002Fweb-hello-world.herokuapp.com\u002F | git@heroku.com:web-hello-world.git\nGit remote heroku added\n$ git push heroku master\n","shell","",[328,329,330,349,370,383,397],"code",{"__ignoreMap":326},[331,332,335,339,343,346],"span",{"class":333,"line":334},"line",1,[331,336,338],{"class":337},"svObZ","$",[331,340,342],{"class":341},"sU2Wk"," heroku",[331,344,345],{"class":341}," create",[331,347,348],{"class":341}," web-hello-world\n",[331,350,352,355,358,361,364,367],{"class":333,"line":351},2,[331,353,354],{"class":337},"Creating",[331,356,357],{"class":341}," web-hello-world...",[331,359,360],{"class":341}," done,",[331,362,363],{"class":341}," stack",[331,365,366],{"class":341}," is",[331,368,369],{"class":341}," cedar\n",[331,371,373,376,380],{"class":333,"line":372},3,[331,374,375],{"class":337},"http:\u002F\u002Fweb-hello-world.herokuapp.com\u002F",[331,377,379],{"class":378},"snl16"," |",[331,381,382],{"class":337}," git@heroku.com:web-hello-world.git\n",[331,384,386,389,392,394],{"class":333,"line":385},4,[331,387,388],{"class":337},"Git",[331,390,391],{"class":341}," remote",[331,393,342],{"class":341},[331,395,396],{"class":341}," added\n",[331,398,400,402,405,408,410],{"class":333,"line":399},5,[331,401,338],{"class":337},[331,403,404],{"class":341}," git",[331,406,407],{"class":341}," push",[331,409,342],{"class":341},[331,411,412],{"class":341}," master\n",[211,414,415,416],{},"And now we can test ",[225,417,419],{"href":375,"rel":418,"target":232},[229,230,231],"the deployment",[211,421,422],{},[225,423,233],{"href":424,"rel":425,"target":232},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fweb-hello-world\u002Fcommit\u002Fc16b997dc03388c6da86486afdbf50d6e9c04088",[229,230,231],[215,427,429],{"id":428},"step-5-push-builds-to-heroku","Step 5 - Push builds to heroku",[211,431,432,433,438],{},"We need to add the heroku information to the travis yaml file. We don't want to have the auth key in plain text - so grab the ",[225,434,437],{"href":435,"rel":436,"target":232},"https:\u002F\u002Fgithub.com\u002Ftravis-ci\u002Ftravis#installation",[229,230,231],"travis command line tool"," and then run",[321,440,442],{"className":323,"code":441,"language":325,"meta":326,"style":326},"$  travis setup heroku\n",[328,443,444],{"__ignoreMap":326},[331,445,446,448,451,454],{"class":333,"line":334},[331,447,338],{"class":337},[331,449,450],{"class":341},"  travis",[331,452,453],{"class":341}," setup",[331,455,456],{"class":341}," heroku\n",[211,458,459],{},"Make sure you choose to encrypt the key.",[211,461,462],{},[225,463,233],{"href":464,"rel":465,"target":232},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fweb-hello-world\u002Fcommit\u002F80ea1e871a45b5172aa599d156f4450efffc51cb",[229,230,231],[215,467,469],{"id":468},"step-6-test-it","Step 6 - Test it",[211,471,472],{},"Change the app, commit and wait. Your change should arrive on the heroku site.",[211,474,475,476],{},"Once it's been tested and deployed - you can see ",[225,477,479],{"href":375,"rel":478,"target":232},[229,230,231],"the change",[211,481,482],{},[225,483,233],{"href":484,"rel":485,"target":232},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fweb-hello-world\u002Fcommit\u002F47a83bc582cc3d6f7181321c266a43d4a6eaf451",[229,230,231],[215,487,489],{"id":488},"more-info","More info:",[242,491,492,499,506,512,519,526,533],{},[245,493,494],{},[225,495,498],{"href":496,"rel":497,"target":232},"http:\u002F\u002Fdocs.travis-ci.com\u002Fuser\u002Fgetting-started\u002F",[229,230,231],"Travis getting started",[245,500,501],{},[225,502,505],{"href":503,"rel":504,"target":232},"http:\u002F\u002Fdocs.travis-ci.com\u002Fuser\u002Flanguages\u002Fjava\u002F",[229,230,231],"Travis java apps",[245,507,508],{},[225,509,511],{"href":435,"rel":510,"target":232},[229,230,231],"Travis command line tool",[245,513,514],{},[225,515,518],{"href":516,"rel":517,"target":232},"https:\u002F\u002Fdevcenter.heroku.com\u002Farticles\u002Fgetting-started-with-java",[229,230,231],"Heroku getting started with java",[245,520,521],{},[225,522,525],{"href":523,"rel":524,"target":232},"https:\u002F\u002Fgithub.com\u002Fchrissearle\u002Fweb-hello-world",[229,230,231],"Project on github",[245,527,528],{},[225,529,532],{"href":530,"rel":531,"target":232},"https:\u002F\u002Ftravis-ci.org\u002Fchrissearle\u002Fweb-hello-world",[229,230,231],"Project on travis",[245,534,535],{},[225,536,538],{"href":375,"rel":537,"target":232},[229,230,231],"Project on heroku",[540,541,543],"h3",{"id":542},"other-useful-links","Other useful links",[242,545,546,553,560,567],{},[245,547,548],{},[225,549,552],{"href":550,"rel":551,"target":232},"https:\u002F\u002Fdevcenter.heroku.com\u002Farticles\u002Fdeploy-a-java-web-application-that-launches-with-jetty-runner",[229,230,231],"Heroku : Using jetty runner",[245,554,555],{},[225,556,559],{"href":557,"rel":558,"target":232},"https:\u002F\u002Fdevcenter.heroku.com\u002Farticles\u002Fjava-webapp-runner",[229,230,231],"Heroku : Deploying Tomcat-based Java Web Applications with Webapp Runner",[245,561,562],{},[225,563,566],{"href":564,"rel":565,"target":232},"http:\u002F\u002Fsamuelsharaf.wordpress.com\u002F2011\u002F11\u002F06\u002Fcreate-a-simple-java-web-app-using-maven-and-upload-to-heroku\u002F",[229,230,231],"Samuel Sharaf : Create a simple Java Web App using Maven and Deploy to Heroku",[245,568,569],{},[225,570,573],{"href":571,"rel":572,"target":232},"https:\u002F\u002Fjersey.java.net\u002Fdocumentation\u002Flatest\u002Fgetting-started.html#heroku-webapp",[229,230,231],"Jersey : Creating a Web Application that can be deployed on Heroku",[575,576,577],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":326,"searchDepth":351,"depth":351,"links":579},[580,581,582,583,584,585,586],{"id":217,"depth":351,"text":218},{"id":236,"depth":351,"text":237},{"id":285,"depth":351,"text":286},{"id":312,"depth":351,"text":313},{"id":428,"depth":351,"text":429},{"id":468,"depth":351,"text":469},{"id":488,"depth":351,"text":489,"children":587},[588],{"id":542,"depth":372,"text":543},null,"2014-01-20 10:47 +0100","md",{},true,"\u002F2014\u002F01\u002F20\u002Fdeploy-from-github-to-heroku-via-travis-ci",{"title":206,"description":213},{"loc":594},"2014\u002F01\u002F20\u002Fdeploy-from-github-to-heroku-via-travis-ci",[599,600,601,602,603,604,605],"maven","java","travis-ci","heroku","continuous integration","continuous deployment","github","i_OeHxxw2UP-4PA9b5xme9urtLhM7gaDQ-gHHgHP4HU",1775293011091]