Orbit

Orbit में Branch Preview Deployments

Branch previews build every non-production, non-staging branch you push to its own isolated URL, so you can click through a change in a real environment before it merges. This guide covers turning…

Branch Previews को सक्षम करना

  1. अपने प्रोजेक्ट को Orbit में खोलें।
  2. Settings टैब खोलें।
  3. Runtime सेक्शन ढूंढें और Branch previews को चालू करें।

एक बार सक्षम होने के बाद, किसी भी ब्रांच पर प्रत्येक push जो आपकी production branch या staging branch नहीं है, एक build को ट्रिगर करता है और इसे अपने preview environment में deploy करता है।

Branch previews toggle in Orbit project settings

Branch previews एक प्रति-प्रोजेक्ट toggle है, कोई paid add-on नहीं। ये Orbit की हर plan पर उपलब्ध हैं, जिसमें free Launch plan भी शामिल है। जो plan के अनुसार भिन्न होता है वह यह है कि एक single project एक बार में कितने environments रख सकता है: Launch 2 (production plus one preview) allow करता है, Liftoff 4, और Apex 11। एक बार जब प्रोजेक्ट अपनी environment limit पर पहुंच जाता है, तब तक further branches को अपना preview नहीं मिलेगा जब तक आप किसी को delete न करें।

Preview URLs

एक preview को अपने branch name से derive किया गया hostname मिलता है: name को lowercase किया जाता है, हर character जो letter, digit या hyphen नहीं है वह hyphen बन जाता है, hyphens का runs collapse हो जाता है, और परिणाम को 48 characters तक truncate किया जाता है और branch- से prefix किया जाता है।

BranchPreview hostname
redesignbranch-redesign.kaps.run
feat/new-checkoutbranch-feat-new-checkout.kaps.run
JB/Fix_Cartbranch-jb-fix-cart.kaps.run

Preview URLs जिस किसी के पास link है वह publicly reachable हैं। ये indexed या advertised नहीं हैं, लेकिन ये access-controlled भी नहीं हैं। किसी भी चीज़ को review करने के लिए preview का उपयोग न करें जो आपकी team को छोड़ नहीं सकती, और किसी preview को production data की ओर point न करें। यदि आपको एक protected pre-production environment की जरूरत है, तो इसके बजाय staging environment का उपयोग करें: staging Settings में Staging: access protection और Staging: IP allowlist सेक्शन में password और IP allowlist को support करता है।

Preview कहां दिखाई देते हैं

प्रोजेक्ट Overview टैब में एक Preview deployments सेक्शन है जो हर active preview को list करता है। प्रत्येक row दिखाता है:

  • Branch name, और एक PR #number badge जो pull request को link करता है जब branch के पास एक open हो
  • Current status (QUEUED, BUILDING, या live)
  • कितने समय पहले इसे deploy किया गया
  • Preview URL को खोलने के लिए एक link
  • View logs deployment detail page को खोलने के लिए
  • एक delete button

प्रत्येक preview एक fully isolated environment है जिसके पास अपना URL, अपना build और अपने environment variables हैं। जो कुछ भी यह करता है वह production को प्रभावित नहीं कर सकता।

प्रोजेक्ट Branches टैब same information को प्रति branch organize किया गया देता है, जो scan करना आसान है जब आपके पास एक बार में कई open हों।

Previews में Environment Variables

यह वह हिस्सा है जो सही तरीके से करने लायक है। एक variable जो All environments (project-wide) के लिए scoped है को preview builds में inject किया जाता है, और एक preview URL public है।

  • Production credentials को केवल अपने production environment के लिए scoped रखें।
  • Previews को third-party services के लिए test-mode या sandbox credentials दें।
  • कभी भी production database URL या live payment key को project-wide scope पर न छोड़ें।

Full mechanics, जिसमें production-only variable को add करने के तरीके और कैसे staging inheritance काम करती है, Setting Environment Variables Per Environment में हैं।

Preview के लिए Build Logs

किसी भी preview के बगल में View logs पर क्लिक करें इसके deployment detail page को खोलने के लिए। Previews को production deployments के समान treatment मिलता है: full streaming build log, build phases, commit और author, artifact size, cache hit या cold build, detected framework और package manager, और AI diagnosis button जब एक build fail हो।

Preview को Delete करना

Preview row पर delete button को क्लिक करें और confirm करें।

एक preview को delete करने से environment और इसका entire build history हटाया जाता है, सिर्फ current deployment नहीं। इसे undo नहीं किया जा सकता। Branch खुद untouched है, इसलिए इसमें फिर से push करने से एक fresh preview scratch से create होता है, कोई history के साथ नहीं और cold build cache के साथ।

Automatic Cleanup

आपको अपने बाद tidy up करने की जरूरत नहीं है।

  • जब एक pull request को close या merge किया जाता है, इसका preview environment तुरंत pause किया जाता है और serve करना बंद कर देता है। Visitors को stale build की बजाय 404 मिलता है।
  • एक branch को delete करने से उस branch के preview को same तरीके से pause किया जाता है।
  • Paused previews को लगभग एक दिन बाद garbage-collect किया जाता है: source tarballs, build artifacts और build caches को delete किया जाता है और environment को archive किया जाता है।

आप previews को एक schedule पर expire भी कर सकते हैं। Settings में, Preview expiry ढूंढें और Never, 7, 14, 30 या 60 days चुनें। उससे पुराने Previews को automatically pause किया जाता है और 24 घंटे के अंदर cleanup किया जाता है।

एक busy repository पर, Preview expiry को 14 या 30 days पर सेट करें। हर active preview आपके project की environment limit के विरुद्ध count करता है, और expired ones एक नई branch के quietly preview पाने में fail करने का usual कारण हैं।

Approval और Previews

यदि Require approval for production को Deploy protection के तहत enable किया गया है, तो यह केवल production पर लागू होता है। Preview builds को approval के लिए hold नहीं किया जाता है।

एक specific preview को further changes को deploy करने से बिना इसे delete किए रोकने के लिए, Environments टैब से environment को pause करें। एक paused environment के लिए new deploys को skip किया जाता है जब तक आप इसे resume न करें।

Troubleshooting

एक branch push किया गया लेकिन कोई preview appear नहीं हुआ। Check करें, order में: क्या Branch previews को Settings, फिर Runtime में on है? क्या branch actually आपकी staging branch है (staging को staging के लिए deploy करता है, preview के लिए नहीं)? क्या branch आपके Branch ignore patterns में से किसी से match करता है, उदाहरण के लिए dependabot/*? क्या project पहले से ही अपनी plan के लिए environment limit पर है?

Preview built लेकिन 404 दिखाता है। Build succeed हुआ लेकिन output directory शायद इस branch के लिए गलत है। Settings में Output directory को check करें, और याद रखें एक branch build output को बदल सकता है बिना setting को बदले। देखें Configuring Your Build Command and Output Directory

Preview एक older commit दिखाता है। एक नए commit को push करना जबकि same branch के लिए एक build अभी भी running है, in-flight build को cancel करता है और एक नया शुरू करता है। यदि आप एक cancelled deployment के बाद एक running को देखते हैं, तो वह expected है। दूसरे build के लिए wait करें।

एक closed PR का preview अभी भी reachable है। Pausing webhook event पर होता है। यदि provider connection disconnected था जब आपने PR को close किया, तो event कभी arrive नहीं हुआ। Overview tab से preview को manually delete करें।

Related Reading

क्या आपको अभी भी सहायता की आवश्यकता है?

हमें ईमेल करें support@kapsulehost.com या KPanel में चैट खोलें।

KPanel खोलें
Orbit में Branch Preview Deployments