Create / Release GitOps CLI as a binary
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.
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 :hammer_and_wrench:
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.
if you have problem with pyinstaller and
File "
you can use --hidden-import
pyinstaller gitopscli/__main__.py --hidden-import gitlab.v4 --hidden-import gitlab.v4.objects -n gitopscli --onefile