File: PACKAGING.md

package info (click to toggle)
ssh-audit 3.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,508 kB
  • sloc: python: 7,318; sh: 661; makefile: 12
file content (83 lines) | stat: -rw-r--r-- 2,162 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# 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.

2.) Install Cygwin (https://www.cygwin.com/).

3.) Install/update package dependencies and create the executable with:

```
    $ ./build_windows_executable.sh
```


# PyPI

To create package and upload to test server (hint: use username '\_\_token\_\_' and API token for test.pypi.org):

```
    $ sudo apt install python3-virtualenv python3.10-venv
    $ 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 for production pypi.org):

```
    $ 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 22.04 VM.

Create the snap package with:
```
    $ ./build_snap.sh
```

Upload the snap with:

```
    $ 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.
```


# Docker

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:

```
    $ make -f Makefile.docker
```

Create a multi-architecture build and upload it to Dockerhub with (hint: use the API token as the password):

```
    $ make -f Makefile.docker upload
```