Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create / Release GitOps CLI as a binary #104

Open
niiku opened this issue Jul 28, 2020 · 3 comments
Open

Create / Release GitOps CLI as a binary #104

niiku opened this issue Jul 28, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@niiku
Copy link
Member

niiku commented Jul 28, 2020

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.

@christiansiegel
Copy link
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 🛠️

@janbrohl
Copy link

janbrohl commented Dec 15, 2020

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.

@epanoff
Copy link

epanoff commented Mar 27, 2023

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

@christiansiegel christiansiegel removed the good first issue Good for newcomers label Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants