Upgrade to Pro — share decks privately, control downloads, hide ads and more …

應用程式佈署

 應用程式佈署

Shengyou Fan

December 14, 2014
Tweet

More Decks by Shengyou Fan

Other Decks in Programming

Transcript

  1. ॄኄੋ PaaSʁ • PaaS = Platform as a Service •

    ฏ୆ଈ෰຿ ੋҰछӢ୺ӡࢉ෰຿ɼ༝෰຿ ڙጯ঎ఏڙ໢࿏ɺ࢕෰ثɺ࡞ۀܥ౷ɺṶ ଘۭؒ౳ɼᩋ࢖༻ऀೳሡଖݪ࢝ᛰ෦ॺࢸ Ӣ୺ɻ࢖༻ऀෆधཁ؅ཧᢛ߇੍Ӣ୺جૅ ઃࢪɼ୞धࣗߦ႔ཧጯ༻ఔࣜ෦ॺᢛݪ࢝ ᛰ؅ཧɻ ˒ ჩߟɿhttp://en.wikipedia.org/wiki/Platform_as_a_service
  2. ࢖༻ PaaS 䆋ॺత޷႔ • ҰൠࣕݴɼPaaS ฏ୆౎ࢧԉ൛ຊ߇੍ɺ PHP ൛ຊઃఆɺଟछࢿྉݿɺಈଶҼጯྲྀ ྔᎷల౳ޭೳ •

    Ҽࠑɼ㟬୞धཁሢ஫ࡏఔࣜ։ᚙଈՄɼଖ ଞॴ༗޻࡞แׅओػ҆᧋ɺ䆋ॺઃఆɺྲྀ ྔᎷॆ౳౎ՄҎ༝ PaaS ࣗಈ׬੒
  3. ॄኄੋ pagoda boxʁ • Ұݸ PaaS ෰຿ɼḼ࡭ாᥒޙɼबՄҎᬋ ࣌䆋ॺଟݸጯ༻ఔࣜࢸ֘ฏ୆ɼฒऔಘಈ ଶ໢ᅿɼڙ։ᚙਓһଌࢼɺDemo •

    ໔අֹ౓ᷮೳ࢖༻༗ݶతӡࢉೳྗ (200MB RAM)ɺ10MB ࢿྉݿɺ׌एጯ༻ ఔࣜແਓᖣ᧸࣌ɼ൓ጯ଎౓။ࣗಈ߱௿ ˒ ჩߟɿhttps://pagodabox.com/cloud-hosting-price
  4. 㗞ੜ SSH Key • pagoda box తԕ୺࿈ઢ࢖༻ SSH ࿈ઢՃ ີɼҼࠑཁઌ㗞ੜҰ૊

    Key ၏ҝՃີۚᮋ • ଧ։ comder.exe ฒ༌ೖҎԼࢦྩ ˒ SSH Key 㗞ੜڭላɿhttp://help.pagodabox.com/customer/portal/articles/202068#setup-ssh-keys-bash $  ssh-­‐keygen  -­‐t  rsa  -­‐C  "{੥׵੒䓟త  email  }" ᙘ໘။੥䓟༌ೖ  passphrase  (ີᛰ)  Մෆ༌ೖ ׬੒ޙ။㗞ੜၷݸ䈕Ҋɿ C:\{Ո໨㑚}\.ssh\id_rsa  (ࢲᮋ) C:\{Ո໨㑚}\.ssh\id_rsa.pub  (ެᮋ)
  5. ొه SSH Key • ઀ஶɼཁ೺ࣗݾతެ錀ొهࡏ pagoda box తாᥒ㚎ɼṜᒬ pagoda box

    ࠽။Ҹڐզ၇ ࿈্ओػ • ੥ઌొೖ pagoda boxɼવޙਐೖாᥒઃఆ https://dashboard.pagodabox.com/account/ edit ˒ SSH Key ొهڭላɿhttp://help.pagodabox.com/customer/portal/articles/202068#add-ssh-pagoda
  6. ⃧Ճ Boxfile • ੥ࡏሢҊࢿྉᇄ㚎৽⃧Ұݸ Boxfile 䈕Ҋ • pagodabox ੋಁաᩇऔ Boxfile

    ྃղጯ༻ఔ ࣜॴधཁతॴ༗ݩ݅ɼฒґর Boxfile 㚎 తࢦྩਐߦࣗಈԽ䆋ॺ • ੥ჩߟڭላൣྫ㚎త Boxfile ਐߦઃఆ ˒ Boxfile 㘸໌ɿhttp://help.pagodabox.com/customer/portal/articles/175475
  7. ઃఆ database.php • ༝ԙ pagoda box త MySQL ࢿྉݿੋࡏୈ Ұ࣍䆋ॺ࣌ࣗಈݐཱతɼҼࠑ࢖༻ऀாᥒ/

    ີᛰ౳ࢿ㘤ɼ။༝ܥ౷؀ڥᏓᏐၚڅ Laravel ࢖༻ • ઃఆ production తࢿྉݿ࿈ઢࢿ㘤ኺܥ౷ ؀ڥᏓᏐ઀ड
  8. ઃఆ database.php • ੥ჩߟڭላጺਓแ㚎త app/config/ database.php ઃఆ production త࿈ઢࢿ㘤 ˒

    database ઃఆ㘸໌ɿhttp://help.pagodabox.com/customer/portal/articles/175426
  9. ҆᧋ adminer • एཁ௚઀࿈্ pagoda box త MySQLɼध ཁ҆᧋ֹ֎త ruby

    ޻۩ɻୠଖመՄಁա ࣗߦ҆᧋໢ท൛޻۩ိᖣ᧸ MySQL 㚎༰ • ੥ሡڭላൣྫ㚎త adminer ࢿྉᇄԼࡌ ޙɼ์ࡏ public ࢿྉᇄఈԼ • ੥ઌࡏຊػ୺ଌࢼ࢖༻ ˒ adminer ׭ํ໢᜾ɿhttp://www.adminer.org/
  10. pagoda box 䆋ॺࢦྩ • ሡ pagoda box ṶଘݿઃఆҝຊػṶଘݿత ԕ୺ •

    ሡຊػṶଘݿత䈕Ҋਪૹ (push) ࢸ pagoda box ओػ $  git  remote  add  pagoda  [email protected]:{App  ໊᜝}.git $  git  push  pagoda  -­‐-­‐all ˒ ჩߟɿhttp://help.pagodabox.com/customer/portal/articles/174146#launch-your-app-on-pagoda-box
  11. ֊ஈᒾ查ද • ֬ೝ༗ pagoda box తாᥒฒՄొೖ • 啟ಈҰݸ pagoda box

    App • ֬ೝ SourceTree త remote ઃఆ • ֬ೝ App ༗Մᖣ᧸తެ։ URLɼฒՄ੒ޭ ᖣ᧸
  12. ޻࡞๥័݁ • ࡏṜݸ޻࡞๥ཫɼզ၇ಁա 12 ݸላशओ ୊ɼኺ։ᚙ؀ڥݐஔᢛ޻۩հ঺ɺ൛ຊ߇ ੍ɺLaravel MVC ٴ Blog

    ޭೳመ࡞ɼҎٴ ্ઢ䆋ॺ౳ɻظ଴ೳኺṜҰ࿈۲తመ࡞ தɼྃղ Laravel ጯ༻ఔࣜ։ᚙతٕ޼ɺ ڗड։ᚙతᒜझʂ