# मॉनिटरिंग और रोलबैक — CI/CD Fundamentals: Pipelines, Testing और Deployment

Source: https://www.skillbyai.com/hi/cicd/cicd-observability

> Monitoring और health checks से हर deploy की स्वस्थता सुनिश्चित करें और पिछले अच्छे artifact पर तेज़ी से rollback करें।

## पाइपलाइन नहीं, डिप्लॉय पर नज़र रखें

एक हरी पाइपलाइन केवल यह साबित करती है कि कोड बना और टेस्ट पास हुए — यह प्रोडक्शन के बारे में कुछ नहीं बताती। डिप्लॉय के बाद, इसे 'पूरा' कहने से पहले कुछ समय तक एरर रेट, लेटेंसी और मुख्य बिज़नेस मेट्रिक देखें।

## रोलबैक रणनीतियाँ

जब कुछ टूटता है, तो सबसे तेज़ समाधान आमतौर पर आख़िरी ज्ञात-सही आर्टिफ़ैक्ट पर **वापस जाना** होता है — प्रोडक्शन में लाइव डीबग करना नहीं। ब्लू-ग्रीन इसे तुरंत बनाती है; रोलिंग डिप्लॉयमेंट बैचों को उसी धीमे तरीके से वापस रोल करती है।

## ट्रिगर को स्वचालित करें

परिपक्व पाइपलाइनें हेल्थ चेक और एरर-रेट अलर्ट को इस तरह जोड़ती हैं कि वे स्वचालित रोलबैक शुरू कर दें, इसके बजाय कि रात 2 बजे किसी इंसान के देखने और कार्रवाई करने का इंतज़ार किया जाए।

## अंतिम क्विज़ 1/8

अंतिम क्विज़

**Quiz:** Continuous integration क्या है?

- [ ] Deploying once a year
- [ ] Manual testing only
- [x] Merging often and verifying each change automatically
- [ ] Branching for months

*Answer:* Merging often and verifying each change automatically. छोटे बार-बार merges conflicts घटाते हैं।

## अंतिम क्विज़ 2/8

अंतिम क्विज़

**Quiz:** Continuous delivery और continuous deployment में क्या अंतर है?

- [ ] Delivery has no tests
- [ ] Deployment skips builds
- [ ] They are identical
- [x] A human approves the production release in delivery

*Answer:* A human approves the production release in delivery. Deployment हर passing बदलाव को अपने-आप release करता है।

## अंतिम क्विज़ 3/8

अंतिम क्विज़

**Quiz:** Artifact केवल एक बार क्यों बनाएँ?

- [x] 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

अंतिम क्विज़

**Quiz:** GitHub Action को version tag या SHA पर pin क्यों करें?

- [ ] It runs faster
- [x] A branch reference can change unexpectedly
- [ ] Branches are not allowed
- [ ] It hides logs

*Answer:* A branch reference can change unexpectedly. Pinning अनपेक्षित या दुर्भावनापूर्ण updates रोकता है।

## अंतिम क्विज़ 5/8

अंतिम क्विज़

**Quiz:** Fail-fast pipeline में कौन-सी checks पहले चलनी चाहिए?

- [ ] Production deploy
- [ ] Slow end-to-end tests
- [x] Fast, cheap ones like linting and unit tests
- [ ] Manual sign-off

*Answer:* Fast, cheap ones like linting and unit tests. सस्ती विफलताएँ समय और पैसा बचाती हैं।

## अंतिम क्विज़ 6/8

अंतिम क्विज़

**Quiz:** किस strategy को duplicate full environment नहीं चाहिए?

- [ ] Blue-green
- [ ] Both
- [ ] Neither
- [x] Rolling deployment

*Answer:* Rolling deployment. Rolling instances को बैचों में बदलता है।

## अंतिम क्विज़ 7/8

अंतिम क्विज़

**Quiz:** CI secrets कहाँ रहने चाहिए?

- [x] 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

अंतिम क्विज़

**Quiz:** Deploy के बाद क्या होना चाहिए?

- [ ] Nothing
- [x] Monitor health and roll back if needed
- [ ] Delete logs
- [ ] Skip alerts

*Answer:* Monitor health and roll back if needed. Deploy तब पूरा है जब स्वस्थ होने की पुष्टि हो जाए।
