🚁

ड्रटोन

सीआई/सीडी & डीएसए

सरल YAML कॉन्फ़िगरेशन के साथ कंटेनर-आधारित निरंतर एकीकरण प्लेटफ़ॉर्म

डेकोमेंट जानकारीName

तैनाती: 2- 5 मि.
वर्ग: सीआई/सीडी & डीएसए
न्यूनतम रैम: 1024MB
सहायता: बधाई तथा ईमेल

इस गाइड को साझा करें

ओवरव्यू

Drone एक आधुनिक, container-native continuous integration और continuous delivery (CI/CD) प्लेटफ़ॉर्म है, जो Docker पर बना है। यह अपनी सरलता, हल्की आर्किटेक्चर और cloud-native डिज़ाइन के लिए अलग है, जिससे इसे डिप्लॉय, स्केल और मेंटेन करना आसान है। पारंपरिक CI/CD सिस्टमों के विपरीत, जिन्हें व्यापक इन्फ़्रास्ट्रक्चर और कॉन्फ़िगरेशन चाहिए, Drone न्यूनतम निर्भरताओं वाली एक हल्की binary के रूप में चलता है, जिससे यह किसी भी आकार की टीम के लिए उपयुक्त है।

Drone को अनोखा बनाता है इसका containerized pipeline दृष्टिकोण: हर build अलग Docker containers में चलता है, जिससे साफ़ और दोहराए जा सकने वाले builds बिना टकराव के सुनिश्चित होते हैं। आपका pipeline कॉन्फ़िगरेशन आपकी repository में रखी एक सरल YAML फ़ाइल है, जिसे version control करना और प्रोजेक्ट्स में दोहराना आसान है। कोड push करने, pull requests खोलने या releases tag करने पर Drone स्वचालित रूप से पहचान लेता है और उपयुक्त pipelines तुरंत चला देता है।

Drone का plugin इकोसिस्टम व्यापक है, जिसमें AWS, Kubernetes, Docker registries, Slack notifications और अन्य पर डिप्लॉय करने के लिए सैकड़ों समुदाय-निर्मित plugins हैं। चूँकि यह Docker-native है, आप किसी भी Docker image को pipeline step के रूप में चला सकते हैं, जिससे असीमित लचीलापन मिलता है। Python 3.11 में tests चलाने हैं? AWS पर डिप्लॉय करना है? Slack notifications भेजने हैं? बस अपनी pipeline में उपयुक्त Docker image का संदर्भ दें।

यह प्लेटफ़ॉर्म GitHub, GitLab, Bitbucket और Gitea सहित सभी प्रमुख version control सिस्टमों को सपोर्ट करता है, और सहज authentication के लिए मूल OAuth इंटीग्रेशन देता है। Drone अधिक runner nodes जोड़कर horizontally स्केल कर सकता है, और कई सर्वरों पर सैकड़ों एक साथ builds संभाल सकता है। इसकी stateless आर्किटेक्चर का मतलब है कि आप जटिल clustering सेटअप के बिना माँग के अनुसार स्केल ऊपर या नीचे कर सकते हैं।

Drone में ये उन्नत सुविधाएँ हैं: कई versions पर testing के लिए matrix builds, branch या tag patterns पर आधारित conditional execution, सुरक्षित credential भंडारण के लिए secrets प्रबंधन, और दोहराए जाने वाले builds को तेज़ करने के लिए build caching। web इंटरफ़ेस साफ़ और सहज है, जो रियल-टाइम logs, build इतिहास और हर pipeline step की विस्तृत जानकारी दिखाता है।

एंटरप्राइज़ टीमों के लिए, Drone में RBAC (role-based access control), audit logs, और सुरक्षा के लिए यह सीमित करने की क्षमता जैसी उन्नत सुविधाएँ हैं कि कौन-सा repository कौन-से plugins इस्तेमाल कर सकता है। autoscaling क्षमताएँ इसे किफ़ायती बनाती हैं: builds कतार में लगने पर ही runners शुरू होते हैं और खाली होने पर बंद हो जाते हैं, जो उन क्लाउड वातावरणों के लिए आदर्श है जहाँ प्रति मिनट भुगतान होता है।

Drone ओपन सोर्स है, और इसके community और enterprise दोनों संस्करण उपलब्ध हैं। community संस्करण पूरी तरह सुविधा-संपन्न है और छोटी से मध्यम आकार की टीमों के लिए उपयुक्त है, जबकि enterprise संस्करण में support contracts, उन्नत सुरक्षा सुविधाएँ और प्राथमिकता वाला support जुड़ता है। चाहे आप startup हों या enterprise, Drone आपकी ज़रूरतों के साथ स्केल करता है।

कुंजी फीचर

कंटेनर-नेटिव पाइपलाइन

हर build step साफ़ और दोहराए जा सकने वाले builds के लिए अलग Docker containers में चलता है, बिना किसी निर्भरता के

सरल YAML कॉन्फ़िगरेशन

आपकी repository में रखी समझने में आसान YAML सिंटैक्स में pipeline को code के रूप में लिखें

व्यापक प्लगइन इकोसिस्टम

डिप्लॉय करने, सूचनाओं, testing और किसी भी सेवा से इंटीग्रेशन के लिए सैकड़ों plugins

ऑटो-स्केलिंग रनर

कई runner nodes के साथ horizontal scaling, जो queue की गहराई के आधार पर स्वचालित रूप से provision और deprovision होते हैं

नेटिव VCS एकीकरण

OAuth और webhook automation के साथ GitHub, GitLab, Bitbucket और Gitea के लिए प्रथम-श्रेणी समर्थन

सीक्रेट प्रबंधन

हर repository या organization के लिए बारीक access control के साथ एन्क्रिप्टेड secrets भंडारण

केस इस्तेमाल करें

• Microservices CI/CD: हर सेवा के लिए अलग, containerized pipelines के साथ कई microservices का build और डिप्लॉय
• Multi-Language Projects: matrix builds (Python 3.8-3.11, Node 14-18 आदि) का उपयोग करके अलग-अलग भाषाओं और versions पर प्रोजेक्ट्स की testing
• Docker Image Builds: Docker images बनाएँ, tag करें और Docker Hub, AWS ECR या निजी registries में push करें
• Kubernetes Deployments: सफल builds के बाद Helm charts या kubectl plugins से Kubernetes डिप्लॉयमेंट स्वचालित करें
• Pull Request Testing: merge से पहले हर PR पर अपने-आप tests चलाएँ, और GitHub/GitLab में status checks इंटीग्रेट करें
• Multi-Environment Deployments: branch patterns और मैन्युअल अनुमोदन के आधार पर dev/staging/production वातावरणों में डिप्लॉय करें
• Infrastructure as Code: स्वचालित pipelines के साथ Terraform, CloudFormation या Ansible कॉन्फ़िगरेशन की testing और डिप्लॉयमेंट करें

संस्थापन गाइड

Ubuntu VPS पर इंस्टॉलेशन:

1. Docker इंस्टॉल करें (यदि पहले से इंस्टॉल नहीं है):
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

# Add current user to docker group
sudo usermod -aG docker $USER
newgrp docker

# Verify installation
docker --version
2. Drone Server कॉन्फ़िगरेशन बनाएँ:
# Create directory for Drone
sudo mkdir -p /var/lib/drone
sudo chown -R $USER:$USER /var/lib/drone

# Create environment file
cat > /var/lib/drone/.env <<'EOF'
# Drone Server Settings
DRONE_SERVER_HOST=drone.yourdomain.com
DRONE_SERVER_PROTO=https
DRONE_RPC_SECRET=$(openssl rand -hex 16)
DRONE_DATABASE_DRIVER=sqlite3
DRONE_DATABASE_DATASOURCE=/data/database.sqlite

# GitHub Integration (or use GitLab/Bitbucket)
DRONE_GITHUB_CLIENT_ID=your_github_oauth_app_id
DRONE_GITHUB_CLIENT_SECRET=your_github_oauth_secret

# Admin user (your GitHub username)
DRONE_USER_CREATE=username:yourgithubusername,admin:true

# Optional: Enable registration
DRONE_REGISTRATION_CLOSED=false
EOF
3. RPC Secret जनरेट करें:
# Generate a secure RPC secret
openssl rand -hex 16
# Update DRONE_RPC_SECRET in .env file
4. GitHub OAuth एप्लिकेशन सेट करें:
- यहाँ जाएँ: https://github.com/settings/applications/new
- एप्लिकेशन का नाम: Drone CI
- होमपेज URL: https://drone.yourdomain.com
- ऑथराइज़ेशन कॉलबैक URL: https://drone.yourdomain.com/login
- Client ID और Client Secret को .env फ़ाइल में कॉपी करें

5. Drone Server शुरू करें:
docker run   --volume=/var/lib/drone:/data   --env-file=/var/lib/drone/.env   --publish=8080:80   --publish=443:443   --restart=always   --detach=true   --name=drone   drone/drone:2
6. Drone Server सत्यापित करें:
# Check container status
docker ps | grep drone

# Check logs
docker logs drone

# Test web interface
curl http://localhost:8080
7. Drone Runner इंस्टॉल करें (Docker Runner):
docker run --detach   --volume=/var/run/docker.sock:/var/run/docker.sock   --env=DRONE_RPC_PROTO=http   --env=DRONE_RPC_HOST=localhost:8080   --env=DRONE_RPC_SECRET=your_rpc_secret_from_env   --env=DRONE_RUNNER_CAPACITY=2   --env=DRONE_RUNNER_NAME=my-first-runner   --publish=3000:3000   --restart=always   --name=runner   drone/drone-runner-docker:1
8. Nginx Reverse Proxy कॉन्फ़िगर करें (प्रोडक्शन):
sudo nano /etc/nginx/sites-available/drone

# Add this configuration:
server {
    listen 80;
    server_name drone.yourdomain.com;

    location / {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

# Enable site
sudo ln -s /etc/nginx/sites-available/drone /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
9. Let's Encrypt से SSL सेट करें:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d drone.yourdomain.com
10. नमूना Pipeline बनाएँ (.drone.yml):
kind: pipeline
type: docker
name: default

steps:
  - name: test
    image: node:18
    commands:
      - npm install
      - npm test

  - name: build
    image: node:18
    commands:
      - npm run build

  - name: docker
    image: plugins/docker
    settings:
      repo: yourusername/yourapp
      tags: latest
      username:
        from_secret: docker_username
      password:
        from_secret: docker_password
    when:
      branch:
        - main
11. Repository जोड़ें:
- Drone web UI में लॉग इन करें: https://drone.yourdomain.com
- GitHub से प्रमाणित करें
- अपनी repository सक्रिय करें
- .drone.yml को अपनी repo में push करें
- build अपने-आप ट्रिगर होता हुआ देखें!

12. Secrets जोड़ें (CLI या UI से):
# Install Drone CLI
curl -L https://github.com/harness/drone-cli/releases/latest/download/drone_linux_amd64.tar.gz | tar zx
sudo install -t /usr/local/bin drone

# Configure CLI
export DRONE_SERVER=https://drone.yourdomain.com
export DRONE_TOKEN=your_user_token_from_ui

# Add secrets
drone secret add --repository yourusername/yourrepo --name docker_username --data yourvalue
drone secret add --repository yourusername/yourrepo --name docker_password --data yourvalue

कॉन्फ़िगरेशन युक्तियाँ

आवश्यक कॉन्फ़िगरेशन:

1. Server कॉन्फ़िगरेशन (.env फ़ाइल):
# Core Settings
DRONE_SERVER_HOST=drone.example.com
DRONE_SERVER_PROTO=https
DRONE_RPC_SECRET=supersecretkey

# Database
DRONE_DATABASE_DRIVER=postgres
DRONE_DATABASE_DATASOURCE=postgres://user:pass@localhost:5432/drone?sslmode=disable

# VCS Integration (GitHub example)
DRONE_GITHUB_CLIENT_ID=github_oauth_app_id
DRONE_GITHUB_CLIENT_SECRET=github_oauth_secret

# User Management
DRONE_USER_CREATE=username:admin,admin:true
DRONE_USER_FILTER=organization_name  # Only allow specific org
2. Pipeline कॉन्फ़िगरेशन (.drone.yml), बुनियादी:
kind: pipeline
type: docker
name: build-test-deploy

steps:
  - name: install
    image: node:18
    commands:
      - npm ci

  - name: test
    image: node:18
    commands:
      - npm test
      - npm run lint

  - name: build
    image: node:18
    commands:
      - npm run build

  - name: deploy
    image: plugins/ssh
    settings:
      host: production.example.com
      username: deploy
      key:
        from_secret: ssh_private_key
      script:
        - cd /var/www/app
        - git pull
        - npm install
        - pm2 restart app
    when:
      branch:
        - main
3. Matrix Builds (कई Versions):
kind: pipeline
type: docker
name: matrix-test

steps:
  - name: test
    image: python:${PYTHON_VERSION}
    commands:
      - pip install -r requirements.txt
      - pytest

matrix:
  PYTHON_VERSION:
    - "3.8"
    - "3.9"
    - "3.10"
    - "3.11"
4. Docker Build और Push:
kind: pipeline
type: docker
name: docker-build

steps:
  - name: build-and-push
    image: plugins/docker
    settings:
      repo: username/myapp
      tags:
        - latest
        - ${DRONE_COMMIT_SHA:0:8}
      username:
        from_secret: docker_username
      password:
        from_secret: docker_password
      dockerfile: Dockerfile
      context: .
5. Kubernetes परिनियोजन:
kind: pipeline
type: docker
name: k8s-deploy

steps:
  - name: deploy-to-k8s
    image: sinlead/drone-kubectl
    settings:
      kubernetes_server: https://k8s.example.com
      kubernetes_token:
        from_secret: k8s_token
      kubernetes_cert:
        from_secret: k8s_cert
    commands:
      - kubectl set image deployment/myapp myapp=username/myapp:${DRONE_COMMIT_SHA}
      - kubectl rollout status deployment/myapp
    when:
      branch:
        - main
6. सशर्त निष्पादन:
kind: pipeline
type: docker
name: conditional-deploy

steps:
  - name: deploy-staging
    image: plugins/ssh
    commands:
      - deploy to staging
    when:
      branch:
        - develop

  - name: deploy-production
    image: plugins/ssh
    commands:
      - deploy to production
    when:
      branch:
        - main
      event:
        - push
        - tag

  - name: deploy-on-tag
    image: plugins/ssh
    commands:
      - deploy release
    when:
      event:
        - tag
      ref:
        - refs/tags/v*
7. Services (Testing के लिए Database, Redis):
kind: pipeline
type: docker
name: integration-tests

services:
  - name: postgres
    image: postgres:14
    environment:
      POSTGRES_USER: testuser
      POSTGRES_PASSWORD: testpass
      POSTGRES_DB: testdb

  - name: redis
    image: redis:7

steps:
  - name: test
    image: python:3.11
    environment:
      DATABASE_URL: postgres://testuser:testpass@postgres:5432/testdb
      REDIS_URL: redis://redis:6379
    commands:
      - pip install -r requirements.txt
      - pytest tests/integration/
8. सीक्रेट प्रबंधन:
# Via CLI
drone secret add --repository user/repo --name aws_access_key --data value
drone secret add --repository user/repo --name aws_secret_key --data value

# In pipeline
kind: pipeline
type: docker
name: default

steps:
  - name: deploy
    image: plugins/s3
    settings:
      access_key:
        from_secret: aws_access_key
      secret_key:
        from_secret: aws_secret_key
      bucket: my-bucket
      source: dist/**/*
9. Dependencies को Cache करना:
kind: pipeline
type: docker
name: cached-build

steps:
  - name: restore-cache
    image: drillster/drone-volume-cache
    volumes:
      - name: cache
        path: /cache
    settings:
      restore: true
      mount:
        - ./node_modules

  - name: build
    image: node:18
    commands:
      - npm ci
      - npm run build

  - name: rebuild-cache
    image: drillster/drone-volume-cache
    volumes:
      - name: cache
        path: /cache
    settings:
      rebuild: true
      mount:
        - ./node_modules

volumes:
  - name: cache
    host:
      path: /var/lib/drone/cache
10. सूचनाएँ (Slack, Email):
kind: pipeline
type: docker
name: notify

steps:
  - name: build
    image: node:18
    commands:
      - npm run build

  - name: slack
    image: plugins/slack
    settings:
      webhook:
        from_secret: slack_webhook
      channel: deployments
      template: >
        {{#success build.status}}
          ✅ Build #{{build.number}} succeeded. Branch: {{build.branch}}
        {{else}}
          ❌ Build #{{build.number}} failed. Branch: {{build.branch}}
        {{/success}}
    when:
      status:
        - success
        - failure
सर्वोत्तम प्रथाएँ:
- संवेदनशील डेटा को secrets में रखें, .drone.yml में कभी नहीं
- latest के बजाय विशिष्ट image tags (node:18) उपयोग करें
- तेज़ builds के लिए caching चालू करें (node_modules, pip packages)
- वास्तविक databases के साथ integration testing के लिए services उपयोग करें
- कई versions की testing के लिए matrix builds लागू करें
- अनावश्यक डिप्लॉयमेंट रोकने के लिए conditional execution उपयोग करें
- उचित branch protection सेट करें (केवल main/master से डिप्लॉय करें)
- build प्रदर्शन पर नज़र रखें और धीमे steps को अनुकूलित करें

तकनीकी तकनीकी

तंत्र आवश्यकताएँ

  • याद: 1024MB रैम

इस लेख को रेट करें

★★★★★
-
लोड किया जा रहा है...

क्या आप अपना एप्लिकेशन डिप्लॉय करने के लिए तैयार हैं? ड्रटोन?

हमारे सादा VPECONECT प्रक्रिया के साथ मिनट में शुरू हो जाओ

Deploy in about 2 minutes • Full root access • Support by ticket and email