ssh-audit/PACKAGING.md

84 lines
2.0 KiB
Markdown
Raw Permalink 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.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.) Install Cygwin (https://www.cygwin.com/).
2021-02-23 15:46:58 +01:00
3.) Install/update package dependencies and 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
2024-10-16 00:29:25 +02:00
To create package and upload to test server (hint: use API token for test.pypi.org):
2021-02-23 15:46:58 +01:00
```
2024-10-16 00:29:25 +02:00
$ sudo apt install python3-virtualenv python3.12-venv
2021-02-23 15:46:58 +01:00
$ make -f Makefile.pypi
$ make -f Makefile.pypi uploadtest
```
To download from test server and verify:
```
2024-10-16 00:29:25 +02:00
$ virtualenv /tmp/pypi_test
2021-02-23 15:46:58 +01:00
$ cd /tmp/pypi_test; source bin/activate
$ pip3 install --index-url https://test.pypi.org/simple ssh-audit
```
2024-10-16 00:29:25 +02:00
To upload to production server (hint: use API token for production pypi.org):
2021-02-23 15:46:58 +01:00
```
$ make -f Makefile.pypi uploadprod
```
To download from production server and verify:
```
2024-10-16 00:29:25 +02:00
$ virtualenv /tmp/pypi_prod
2021-02-23 15:46:58 +01:00
$ cd /tmp/pypi_prod; source bin/activate
$ pip3 install ssh-audit
```
2021-02-23 15:46:58 +01:00
# Snap
2024-10-16 00:29:25 +02:00
To create the Snap package, run a fully-updated Ubuntu Server 24.04 VM.
2021-02-23 15:46:58 +01:00
2024-10-16 00:29:25 +02:00
Create the Snap package with:
2021-02-23 15:46:58 +01:00
```
$ ./build_snap.sh
2021-02-23 15:46:58 +01:00
```
2024-10-16 00:29:25 +02:00
Upload the Snap with:
2021-02-23 15:46:58 +01:00
```
2023-04-29 20:42:54 +02:00
$ snapcraft export-login ~/snap_creds.txt
$ export SNAPCRAFT_STORE_CREDENTIALS=$(cat ~/snap_creds.txt)
$ snapcraft upload --release=beta ssh-audit_*.snap
$ snapcraft status ssh-audit # Note the revision number of the beta channel.
$ snapcraft release ssh-audit X stable # Fill in with the revision number.
2021-02-23 15:46:58 +01:00
```
# Docker
2024-10-16 00:29:25 +02:00
Ensure that the `buildx` plugin is available by following the installation instructions available at: https://docs.docker.com/engine/install/ubuntu/
Build a local image with:
2021-02-23 15:46:58 +01:00
```
$ make -f Makefile.docker
```
Create a multi-architecture build and upload it to Dockerhub with (hint: use the API token as the password):
2021-02-23 15:46:58 +01:00
```
$ make -f Makefile.docker upload
2021-02-24 16:18:12 +01:00
```