ssh-audit/PACKAGING.md

85 lines
1.6 KiB
Markdown
Raw Normal View History

2021-02-23 15:46:58 +01:00
# Windows
An executable can only be made on a Windows host because the PyInstaller tool (https://www.pyinstaller.org/) does not support cross-compilation.
1.) Install Python v3.11.x from https://www.python.org/. To make life easier, check the option to add Python to the PATH environment variable.
2021-02-23 15:46:58 +01:00
2.) Using pip, install pyinstaller, colorama, and idna:
2021-02-23 15:46:58 +01:00
```
pip install -U pyinstaller colorama idna
2021-02-23 15:46:58 +01:00
```
2021-02-24 16:18:12 +01:00
3.) Install Cygwin (https://www.cygwin.com/).
4.) Create the executable with:
2021-02-23 15:46:58 +01:00
```
2021-02-24 16:18:12 +01:00
$ ./build_windows_executable.sh
2021-02-23 15:46:58 +01:00
```
2021-02-24 16:18:12 +01:00
2021-02-23 15:46:58 +01:00
# 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
```
2021-02-24 16:18:12 +01:00
To upload to production server (hint: use username '\_\_token\_\_' and API token):
2021-02-23 15:46:58 +01:00
```
$ 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
```
2021-02-23 15:46:58 +01:00
# Snap
To create the snap package, run a fully-updated Ubuntu Server 20.04 VM.
Create the snap package with:
2021-02-23 15:46:58 +01:00
```
$ ./build_snap.sh
2021-02-23 15:46:58 +01:00
```
Upload the snap with:
```
$ snapcraft login
$ snapcraft upload --release=stable ssh-audit_*.snap
```
# Docker
Build image with:
```
$ make -f Makefile.docker
```
2021-02-24 16:18:12 +01:00
Then upload it to Dockerhub with:
2021-02-23 15:46:58 +01:00
```
$ make -f Makefile.docker upload
2021-02-24 16:18:12 +01:00
```