From 8f9771c4e63942268275fcdcd29aaa9bc72780bd Mon Sep 17 00:00:00 2001 From: Joe Testa Date: Tue, 23 Feb 2021 09:46:58 -0500 Subject: [PATCH] Added markdown to PACKAGING. --- PACKAGING | 82 ------------------------------------------- PACKAGING.md | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+), 82 deletions(-) delete mode 100644 PACKAGING create mode 100644 PACKAGING.md diff --git a/PACKAGING b/PACKAGING deleted file mode 100644 index 5fd88fc..0000000 --- a/PACKAGING +++ /dev/null @@ -1,82 +0,0 @@ -= Windows = - -An executable can only be made on a Windows host because the PyInstaller tool (https://www.pyinstaller.org/) does not support cross-compilation. - -On a Windows machine, do the following: - -1.) Install Python v3.7.x from https://www.python.org/. (As of this writing v3.8.0 isn't supported.) To make life easier, check the option to add Python to the PATH environment variable. - -2.) Using pip, install pyinstaller and colorama: - - pip install pyinstaller colorama - -3.) Create the executable with: - - cd src\ssh_audit - rename ssh_audit.py ssh-audit.py - pyinstaller -F --icon ..\..\windows_icon.ico ssh-audit.py - ---- - -= PyPI = - -To create package and upload to test server: - -$ sudo apt install python3-virtualenv -$ make -f Makefile.pypi -$ make -f Makefile.pypi uploadtest - - -To download from test server and verify: - -$ virtualenv -p /usr/bin/python3 /tmp/pypi_test -$ cd /tmp/pypi_test; source bin/activate -$ pip3 install --index-url https://test.pypi.org/simple ssh-audit - - -To upload to production server (hint: use username '__token__' and API token): - -$ make -f Makefile.pypi uploadprod - - -To download from production server and verify: - -$ virtualenv -p /usr/bin/python3 /tmp/pypi_prod -$ cd /tmp/pypi_prod; source bin/activate -$ pip3 install ssh-audit - ----- - -= Snap = - -To create the snap package, run a fully-updated Ubuntu Server 20.04 VM. - -Install pre-requisites with: - -$ sudo apt install make snapcraft -$ sudo snap install review-tools - -Initialize LXD (leave all options default): - -$ sudo lxd init - -Bump the version number in snapcraft.yaml. Then run: - -$ make -f Makefile.snap - -Upload the snap with: - -$ snapcraft login -$ snapcraft upload --release=stable ssh-audit_*.snap - ----- - -= Docker = - -Build image with: - -$ make -f Makefile.docker - -Then upload them to Dockerhub with: - -$ make -f Makefile.docker upload diff --git a/PACKAGING.md b/PACKAGING.md new file mode 100644 index 0000000..2f8e681 --- /dev/null +++ b/PACKAGING.md @@ -0,0 +1,98 @@ +# Windows + +An executable can only be made on a Windows host because the PyInstaller tool (https://www.pyinstaller.org/) does not support cross-compilation. + +On a Windows machine, do the following: + +1.) Install Python v3.9.x from https://www.python.org/. To make life easier, check the option to add Python to the PATH environment variable. + +2.) Using pip, install pyinstaller and colorama: + +``` + pip install pyinstaller colorama +``` + +3.) Create the executable with: + +``` + cd src\ssh_audit + rename ssh_audit.py ssh-audit.py + pyinstaller -F --icon ..\..\windows_icon.ico ssh-audit.py +``` + +# PyPI + +To create package and upload to test server: + +``` + $ sudo apt install python3-virtualenv + $ make -f Makefile.pypi + $ make -f Makefile.pypi uploadtest +``` + +To download from test server and verify: + +``` + $ virtualenv -p /usr/bin/python3 /tmp/pypi_test + $ cd /tmp/pypi_test; source bin/activate + $ pip3 install --index-url https://test.pypi.org/simple ssh-audit +``` + +To upload to production server (hint: use username '__token__' and API token): + +``` + $ make -f Makefile.pypi uploadprod +``` + +To download from production server and verify: + +``` + $ virtualenv -p /usr/bin/python3 /tmp/pypi_prod + $ cd /tmp/pypi_prod; source bin/activate + $ pip3 install ssh-audit +``` + +# Snap + +To create the snap package, run a fully-updated Ubuntu Server 20.04 VM. + +Install pre-requisites with: + +``` + $ sudo apt install make snapcraft + $ sudo snap install review-tools +``` + +Initialize LXD (leave all options default): + +``` + $ sudo lxd init +``` + +Bump the version number in snapcraft.yaml. Then run: + +``` + $ make -f Makefile.snap +``` + +Upload the snap with: + +``` + $ snapcraft login + $ snapcraft upload --release=stable ssh-audit_*.snap +``` + + +# Docker + +Build image with: + +``` + $ make -f Makefile.docker +``` + +Then upload them to Dockerhub with: + +``` + $ make -f Makefile.docker upload +``` \ No newline at end of file