Skip to main content

odoo-sh-gitlab-ci

This package simplifies and automates the process of updating Odoo.sh branches by interacting with a GitLab repository while using a GitHub repository as a container for multiple repositories. It ensures seamless management of submodules and branch synchronization, making the deployment process more efficient and maintainable.

Installation

Install the package using pip:

pip install odoo-sh-gitlab-ci

Usage

The package provides a command-line tool odoo_sh_deploy that can be used in two modes:

  • Initialization Mode (--initialize): Prepares the environment by configuring the SSH agent, adding SSH keys, and setting up Git configurations.
  • Deployment Mode: Performs the actual deployment to Odoo.sh.

Setting Up variables.sh

To simplify the configuration of environment variables, you can create a file called variables.sh in the root of your repository. Define your variables in this file using the following format:

export PRIVATE_DEPLOY_KEY="your_private_ssh_key"
export GITHUB_REPO="git@github.com:youruser/yourrepo.git"
export GITHUB_REPO_NAME="yourrepo"
export VERSION="18.0"

Example variables.sh

export PRIVATE_DEPLOY_KEY="-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA1o9qX..."
export GITHUB_REPO="git@github.com:youruser/yourrepo.git"
export GITHUB_REPO_NAME="yourrepo"
export VERSION="18.0"

Important: For security reasons, it is recommended to define PRIVATE_DEPLOY_KEY as a protected variable in GitLab CI/CD settings instead of hardcoding it in the variables.sh file.

GitLab CI Configuration

To use odoo-sh-gitlab-ci in a GitLab CI pipeline, follow these steps:

  1. Add the variables.sh file to Your Repository: Ensure the variables.sh file is located in the root of your repository.

  2. Update .gitlab-ci.yml: Use the following configuration in your .gitlab-ci.yml:

    odoo_sh_deploy:
      stage: pre
      tags:
        - odoo
      before_script:
        - 'command -v ssh-agent >/dev/null || ( apk add --update openssh )'
        - eval $(ssh-agent -s)
        - source variables.sh
        - pip install --root-user-action ignore odoo-sh-gitlab-ci
        - odoo_sh_deploy --initialize
      script:
        - source variables.sh
        - odoo_sh_deploy
    
    • before_script: This section installs the package and initializes the environment using the --initialize flag.
    • script: This section performs the deployment using odoo_sh_deploy.
  3. Example Pipeline Stages: Here’s a full example of a pipeline that uses odoo-sh-gitlab-ci:

    stages:
      - pre
    
    odoo_sh_deploy:
      stage: pre
      tags:
        - odoo
      before_script:
        - 'command -v ssh-agent >/dev/null || ( apk add --update openssh )'
        - eval $(ssh-agent -s)
        - source variables.sh
        - pip install --root-user-action ignore odoo-sh-gitlab-ci
        - odoo_sh_deploy --initialize
      script:
        - source variables.sh
        - odoo_sh_deploy
    

License

This project is licensed under the AGPL-3.0 License.

Metadata

Release files for odoo-sh-gitlab-ci 1.0.26

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for odoo-sh-gitlab-ci 1.0.26
File Size Uploaded Provenance Actions
odoo_sh_gitlab_ci-1.0.26.tar.gz 8.3 kB Without provenance Details for odoo_sh_gitlab_ci-1.0.26.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for odoo-sh-gitlab-ci 1.0.26
File Interpreter ABI Platform Actions
odoo_sh_gitlab_ci-1.0.26-py3-none-any.whl Python 3 none any Details for odoo_sh_gitlab_ci-1.0.26-py3-none-any.whl

Total release size: 14.9 kB

Release files / odoo_sh_gitlab_ci-1.0.26.tar.gz

Download URL odoo_sh_gitlab_ci-1.0.26.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
aaf8f5525bfb5d66677cc66338e1d686fb62d316acdf3cf338ff2a6d68f8ee41
BLAKE2b-256 checksum
How to use checksums
329f2d1c841a7c7675ae4e87662b803394751e8fab6d69a14770816aa6c45a76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Release files / odoo_sh_gitlab_ci-1.0.26-py3-none-any.whl

Download URL odoo_sh_gitlab_ci-1.0.26-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
298d5af05ff2a058a9390b0738ab19758833bf2a0591b82c712d089b9e55b538
BLAKE2b-256 checksum
How to use checksums
36701efc1838ef5938d0158d542b6730ab28d8134486546d9491ee0b7e502117
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.17

Security for odoo-sh-gitlab-ci 1.0.26

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page