Skip to content

NADOOIT/NADOO-Migration-Framework

Repository files navigation

NADOO Migration Framework

A powerful, Git-based migration framework for NADOO Framework projects. This tool helps you:

  • Migrate older NADOO Framework projects to newer versions
  • Convert non-NADOO projects to NADOO Framework projects
  • Manage dependencies in NADOO Framework projects

Installation

You can install the NADOO Migration Framework using pip:

pip install nadoo-migration-framework

Or using Poetry:

poetry add nadoo-migration-framework

After installation, the following commands will be available globally in your terminal:

  • nadoo - Main command with all subcommands
  • nadoo-init - Quick command to create new projects
  • nadoo-migrate - Quick command to run migrations
  • nadoo-add - Quick command to add packages

Usage

Creating a New Project

Create a new NADOO Framework project:

# Using the main command
nadoo init my-project

# Or using the quick command
nadoo-init my-project

# Specify a custom path
nadoo init my-project --path /path/to/projects

Migrating a Project

To migrate a project to the latest NADOO Framework version:

# In your project directory
nadoo migrate

# Or using the quick command
nadoo-migrate

# Specify a project path
nadoo migrate /path/to/project

# Force migration even if checks fail
nadoo migrate --force

The migration tool will:

  1. Analyze your project structure
  2. Detect if it's a NADOO Framework project or not
  3. Determine required migrations
  4. Apply migrations with Git-based version control

Adding Packages

To add a package to your NADOO Framework project:

# Using the main command
nadoo add package-name

# Or using the quick command
nadoo-add package-name

# Add as development dependency
nadoo add package-name --dev

This will:

  1. Add the package to your project's dependencies
  2. Update your project configuration
  3. Install the package using your package manager

Quick Start: Adding NADOO to Your Project

  1. Install the package:
pip install nadoo-migration-framework
  1. Create .github/workflows/nadoo-check.yml in your project:
name: NADOO Framework Check

on:
  push:
    branches: [ main, master ]
  pull_request:
    branches: [ main, master ]
  schedule:
    - cron: '0 0 * * *'  # Daily check

jobs:
  check-nadoo-compatibility:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.x'
      - name: Install NADOO Migration Framework
        run: |
          python -m pip install --upgrade pip
          pip install nadoo-migration-framework
      - name: Check NADOO Framework Compatibility
        id: check
        continue-on-error: true
        run: |
          nadoo check --json > nadoo-check.json

That's it! The workflow will now:

  1. Check your project daily for NADOO compatibility
  2. Create issues if migration is needed
  3. Automatically create PRs with migration changes
  4. Keep your project up to date with the latest NADOO standards

What Happens Next?

  1. If your project needs migration:

    • An issue will be created explaining what needs to be changed
    • A PR will be created with automatic migrations
    • You can review and merge the changes
  2. If your project is compatible:

    • The check will pass silently
    • You'll be notified of any new updates
  3. If migration fails:

    • An issue will be created with details
    • You can run nadoo migrate --debug locally to investigate

Command Reference

Main Command (nadoo)

The main command with all functionality:

nadoo [COMMAND] [OPTIONS]

Commands:
  init      Create a new NADOO Framework project
  migrate   Migrate a project to the latest version
  add       Add a package to the project

Quick Commands

Standalone commands for common operations:

  • nadoo-init: Create new projects

    nadoo-init PROJECT_NAME [--path PATH]
  • nadoo-migrate: Run migrations

    nadoo-migrate [PROJECT_PATH] [--force]
  • nadoo-add: Add packages

    nadoo-add PACKAGE_NAME [--dev]

Features

  • Intelligent Project Analysis: Automatically detects project type and structure
  • Git Integration: All migrations are tracked with Git commits
  • Safe Migrations: Automatic rollback on failure
  • Package Management: Integrated with NADOO Framework package management
  • Extensible: Easy to add new migration strategies
  • Global Commands: Quick access to common operations

Development

To contribute to the NADOO Migration Framework:

  1. Clone the repository:
git clone https://github.com/NADOOIT/nadoo-migration-framework.git
cd nadoo-migration-framework
  1. Install dependencies:
poetry install
  1. Run tests:
poetry run pytest

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages