GitLab CI Environments: Staging, Production, and More

Day 43/100 - Managing Environments in GitLab CI/CD 🚀 When we work on real projects, do we deploy directly to production? No na! We always have multiple environments like: ✅ Development ✅ Staging / UAT ✅ Production In GitLab CI, an "environment" simply means — WHERE your code is deployed. Dev server, staging server, or production server. Why are environments so important? 🔍 👉 You can track which version is running where 👉 You can see deployment history — who deployed what and when 👉 You can test safely in lower environments before touching production Here's how we define environments in .gitlab-ci.yml: ```yaml deploy_staging:  stage: deploy  script:   - ./deploy.sh staging  environment:   name: staging   url: https://lnkd.in/gkG9GJ-N deploy_production:  stage: deploy  script:   - ./deploy.sh production  environment:   name: production   url: https://example.com ``` 🔹 name = name of the environment (staging, production, etc.) 🔹 url = link where app is running, visible from GitLab UI Tomorrow I'll cover: → Best practices for dev, staging & prod environments → How to avoid mistakes while deploying to production → How environments help in rollback and debugging Drop a comment: "Environments matter" — so I know you're learning with me! 💬 If you found this useful: ❤️ Like | 🔄 Repost | ➕ Follow #Day43 #100DaysOfGitLabCI #GitLab #DevOps #CICD #GitLabCI #DevOpsEngineer #SalesforceDevOps #IndiaTech

To view or add a comment, sign in

Explore content categories