Skip to content

Create / Release GitOps CLI as a binary #104

Open

Description

@niiku

The GitOps CLI should be released as a self contained binary so it could be used without Docker or Python installed locally.

It would be the best if it would be included in the release step.

To create a binary for a Python application I tested PyInstaller which worked great so far:

pip3 install pyinstaller
# Move to the gitopscli repository
pyinstaller gitopscli/__main__.py -n gitopscli --onefile

Afterwards, the executable binary is available under dist/gitopscli

Releasing the GitOps CLI as binary would open the door to add developer. I'm thinking about commands like:

gitopscli login --git-server bitbucket.example.tld --root-config <path-to-root-config>
gitopscli create deployment --name demo-test --image=org/myimage:latest --host=app.example.tld --config-repo example-non-prod ...
gitopscli promote --from demo-test --to demo-int

etc.

Activity

  1. christiansiegel commented on Sep 11, 2020

    @christiansiegel
    Member

    PyInstaller can't cross-compile windows binaries from linux (pyinstaller/pyinstaller#2613). I guess we could work around that with wine (e.g. https://github.com/cdrx/docker-pyinstaller) ...already feels a bit hacky though 🛠️

  2. janbrohl commented on Dec 15, 2020

    @janbrohl

    One option for systems with Python installed (most linuxes) already would be to release an actual installation package for pip (zip, wheel) and use console scripts (I see you already provide one in setup.py)
    For Windows users (without Python) Pyinstaller is still an option - or just a prepackaged pypy zip / install Script.

  3. epanoff commented on Mar 27, 2023

    @epanoff

    if you have problem with pyinstaller and
    File "", line 1004, in _find_and_load_unlocked
    ModuleNotFoundError: No module named 'gitlab.v4'
    [11927] Failed to execute script 'main' due to unhandled exception!

    you can use --hidden-import
    pyinstaller gitopscli/__main__.py --hidden-import gitlab.v4 --hidden-import gitlab.v4.objects -n gitopscli --onefile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions