Skip to main content

Utility to clone odoo modules repository with requirements installation

Project description

odoogci

A utility for cloning Git repositories, removing unnecessary files, and installing dependencies from requirements.txt. It is specifically designed to facilitate building Odoo Docker images.

Features

  • Recursive Cloning: Automatically handles submodules recursively.
  • Authentication Support: Easy integration with GitHub and GitLab tokens.
  • JSON Batch Processing: Clone multiple repositories with a single command.
  • Verbose Mode: Detailed real-time progress of cloning, updates, and submodule processing.
  • Safe Authentication: Prevents hangs by disabling interactive prompts during Git operations.

Requirements

Ensure you have the following tools installed on your system:

  • Python ^3.9
  • Git
  • pip (Python package manager)

Installation

Via pipx (Recommended for CLI)

pipx install odoogci

Via pip

pip install odoogci

In a Dockerfile (From source)

Add the following line to your Dockerfile:

RUN pip3 install git+https://github.com/Alitux/odoogci.git

Usage

The general usage of the tool is:

odoogci [URL] [OPTIONS]

Arguments

  • URL: URL of the repository to clone.

Options

  • --branch TEXT: Branch of the repository.
  • --repositories TEXT: JSON string with a list of repositories to clone.
  • --requirements / --no-requirements: Install dependencies from requirements.txt. [default: no-requirements]
  • --repopath TEXT: Local path where the repository will be cloned.
  • --token TEXT: Access token for the repository (supports GitHub and GitLab).
  • --verbose / -v: Enable detailed output of all operations.

Examples

Simple Clone

odoogci https://github.com/ingadhoc/odoo-argentina --branch 16.0

Clone Multiple Repositories using JSON

You can specify the token, branch, and path per repository.

odoogci --repositories '[
    {
        "url": "https://github.com/org/repo1",
        "branch": "18.0",
        "repo_path": "repo1",
        "token": "your_github_token"
    },
    {
        "url": "https://github.com/OCA/commission",
        "branch": "18.0",
        "repo_path": "oca/commission"
    }
]'

Verbose Output

See exactly what is happening, including submodule updates:

odoogci https://github.com/ingadhoc/odoo-argentina -v

Usage in a Dockerfile

RUN cd /usr/lib/python3/dist-packages/odoo/addons/ && \
    odoogci https://github.com/ingadhoc/odoo-argentina --branch 16.0 && \
    odoogci https://github.com/ingadhoc/account-invoicing --branch 16.0

Parameter Precedence

When using the --repositories (JSON) option:

  1. Branch: If a global --branch is provided, it overrides all branches in the JSON. If not, the branch in the JSON is used. If none is specified, it clones the default branch.
  2. Token: If a global --token is provided, it overrides all tokens in the JSON.
  3. Recursivity: All operations (clones and updates) are performed with --recursive by default.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

odoogci-0.2.6.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

odoogci-0.2.6-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file odoogci-0.2.6.tar.gz.

File metadata

  • Download URL: odoogci-0.2.6.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.14.4 Linux/7.0.3-arch1-2

File hashes

Hashes for odoogci-0.2.6.tar.gz
Algorithm Hash digest
SHA256 2c7b8b74835bd12d7bb28e7d71a945878637c473e6c5ca0d5e468964096b1700
MD5 b1af48ce2ddc1472d688c692e865506e
BLAKE2b-256 a3b14a90b6d3834520fc9b57e55b600342c3e14b3a2f2ee3a22573d131d96134

See more details on using hashes here.

File details

Details for the file odoogci-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: odoogci-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.14.4 Linux/7.0.3-arch1-2

File hashes

Hashes for odoogci-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0c03fc0a2fbad3bb197fdcd8e99a05239f0c4c370e2166df01b6f40a4de5ee8d
MD5 b41a7cb0e53832861b241dbda86578bb
BLAKE2b-256 72fd018dc1a2e0f887754df972f8dd03d57fb8ebfc1cea4cd6db68e62b2a2903

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page