पाठ 22 / 23
मॉनिटरिंग और रोलबैक
Monitoring और health checks से हर deploy की स्वस्थता सुनिश्चित करें और पिछले अच्छे artifact पर तेज़ी से rollback करें।
पाइपलाइन नहीं, डिप्लॉय पर नज़र रखें
एक हरी पाइपलाइन केवल यह साबित करती है कि कोड बना और टेस्ट पास हुए — यह प्रोडक्शन के बारे में कुछ नहीं बताती। डिप्लॉय के बाद, इसे 'पूरा' कहने से पहले कुछ समय तक एरर रेट, लेटेंसी और मुख्य बिज़नेस मेट्रिक देखें।
रोलबैक रणनीतियाँ
जब कुछ टूटता है, तो सबसे तेज़ समाधान आमतौर पर आख़िरी ज्ञात-सही आर्टिफ़ैक्ट पर वापस जाना होता है — प्रोडक्शन में लाइव डीबग करना नहीं। ब्लू-ग्रीन इसे तुरंत बनाती है; रोलिंग डिप्लॉयमेंट बैचों को उसी धीमे तरीके से वापस रोल करती है।
ट्रिगर को स्वचालित करें
परिपक्व पाइपलाइनें हेल्थ चेक और एरर-रेट अलर्ट को इस तरह जोड़ती हैं कि वे स्वचालित रोलबैक शुरू कर दें, इसके बजाय कि रात 2 बजे किसी इंसान के देखने और कार्रवाई करने का इंतज़ार किया जाए।
अंतिम क्विज़ 1/8
अंतिम क्विज़
त्वरित जाँच: Continuous integration क्या है?
- Deploying once a year
- Manual testing only
- Merging often and verifying each change automatically
- Branching for months
Answer
Merging often and verifying each change automatically — छोटे बार-बार merges conflicts घटाते हैं।
अंतिम क्विज़ 2/8
अंतिम क्विज़
त्वरित जाँच: Continuous delivery और continuous deployment में क्या अंतर है?
- Delivery has no tests
- Deployment skips builds
- They are identical
- A human approves the production release in delivery
Answer
A human approves the production release in delivery — Deployment हर passing बदलाव को अपने-आप release करता है।
अंतिम क्विज़ 3/8
अंतिम क्विज़
त्वरित जाँच: Artifact केवल एक बार क्यों बनाएँ?
- So the exact tested output is what gets deployed
- To save disk space only
- To skip tests
- Because builds are random
Answer
So the exact tested output is what gets deployed — हर stage पर rebuild करने से परिणाम बदल सकता है।
अंतिम क्विज़ 4/8
अंतिम क्विज़
त्वरित जाँच: GitHub Action को version tag या SHA पर pin क्यों करें?
- It runs faster
- A branch reference can change unexpectedly
- Branches are not allowed
- It hides logs
Answer
A branch reference can change unexpectedly — Pinning अनपेक्षित या दुर्भावनापूर्ण updates रोकता है।
अंतिम क्विज़ 5/8
अंतिम क्विज़
त्वरित जाँच: Fail-fast pipeline में कौन-सी checks पहले चलनी चाहिए?
- Production deploy
- Slow end-to-end tests
- Fast, cheap ones like linting and unit tests
- Manual sign-off
Answer
Fast, cheap ones like linting and unit tests — सस्ती विफलताएँ समय और पैसा बचाती हैं।
अंतिम क्विज़ 6/8
अंतिम क्विज़
त्वरित जाँच: किस strategy को duplicate full environment नहीं चाहिए?
- Blue-green
- Both
- Neither
- Rolling deployment
Answer
Rolling deployment — Rolling instances को बैचों में बदलता है।
अंतिम क्विज़ 7/8
अंतिम क्विज़
त्वरित जाँच: CI secrets कहाँ रहने चाहिए?
- In the CI system's encrypted secret store
- In the repository code
- In README files
- In the build artifact
Answer
In the CI system's encrypted secret store — Credentials को git में कभी commit न करें।
अंतिम क्विज़ 8/8
अंतिम क्विज़
त्वरित जाँच: Deploy के बाद क्या होना चाहिए?
- Nothing
- Monitor health and roll back if needed
- Delete logs
- Skip alerts
Answer
Monitor health and roll back if needed — Deploy तब पूरा है जब स्वस्थ होने की पुष्टि हो जाए।