logo
0
0
Login
docs: add README.en.md

CNB Deployment Configuration Project

This is a deployment configuration project based on CNB (Cloud Native Build) for managing deployment processes and configurations across different environments.

The project uses .cnb/tag_deploy.yml file for unified deployment environment configuration management. The .cnb.yml file configures deployment pipelines with support for multi-environment deployment strategies.

Project Features

  • Supports multi-environment deployment (three environments configured: Development, Staging, Production)
  • Unified configuration management approach
  • Simple and clear deployment process
  • Flexible environment variable configuration
  • Deployment preconditions configuration: metadata, environment, approval workflow

Environment Configuration

The project supports three deployment environments, each with specific configurations:

Development Environment

tag_deploy.development: - name: dev stages: - name: Environment name script: echo $name - name: Tag name script: echo $tag_name

Staging Environment

tag_deploy.staging: - name: staging stages: - name: Environment name script: echo $name - name: Tag name script: echo $tag_name

Production Environment

tag_deploy.production: - name: production stages: - name: Environment name script: echo $name - name: Tag name script: echo $tag_name

Deployment Process

Each environment's deployment process includes the following steps:

  1. Environment Name Confirmation

    • System outputs current deployment environment name
    • Verifies correct deployment target environment
  2. Tag Version Confirmation

    • Outputs current deployment tag name
    • Used for version tracking and deployment verification
  3. Deployment Execution

    • Executes corresponding deployment scripts based on environment configuration
    • Automatically completes deployment process

Usage Guide

Configuration File Explanation

The core configuration file is .cnb.yml, which defines all environment deployment configurations. File structure:

$: tag_deploy.[environment]: - name: [environment identifier] stages: - name: [step name] script: [execution script]

Configuration Management

  1. Modify Environment Configuration

    • Edit .cnb.yml file directly
    • Add or modify deployment steps under corresponding environment
    • Changes take effect immediately after saving
  2. Add New Deployment Steps

    • Add new configuration items under environment's stages
    • Configure name and script following existing format

Deployment Commands

Use the following commands for different environments:

  • Development: cnb tag_deploy development
  • Staging: cnb tag_deploy staging
  • Production: cnb tag_deploy production

Important Notes

Environment-Specific Considerations

  1. Development Environment

    • For development testing, frequent deployments allowed
    • Recommended for thorough testing of configuration changes
  2. Staging Environment

    • For pre-release testing
    • Recommended to simulate production environment configuration
  3. Production Environment

    • Production deployment requires special caution
    • Complete testing and verification recommended before deployment
    • Important changes require review

Key Deployment Process Points

  1. Configuration Validation

    • Verify configuration file format before deployment
    • Ensure environment variables are properly configured
  2. Version Management

    • Ensure correct tag version is used
    • Maintain consistent version naming conventions
  3. Deployment Monitoring

    • Monitor output information during deployment
    • Address potential errors promptly
  4. Rollback Mechanism

    • Backup critical data before deployment
    • Establish clear rollback strategy

Deployment Preconditions

Configure deployment preconditions in .cnb/tag_deploy.yml file. Deployment proceeds only when preconditions are met:

  • Environment: Dependent environments successfully deployed
  • Metadata: Metadata values meet requirements
  • Approval Workflow: Approval obtained