Building: describe how to build and test packages

This commit is contained in:
Dmitry Maksyoma 2021-04-13 22:47:10 +12:00
parent f532e3244b
commit e7f8caa752

View File

@ -1,12 +1,6 @@
## REQIUREMENTS ## REQIUREMENTS
Docker CE Docker CE
# Build the www webpack
```
docker build -t kasmweb/www -f builder/dockerfile.www.build .
docker run -it --rm -v $PWD/builder/www:/build kasmweb/www:latest
```
# Build a deb/rpm package # Build a deb/rpm package
``` ```
# builder/build-package <os> <os_codename> # builder/build-package <os> <os_codename>
@ -22,29 +16,55 @@ builder/build-package centos core # CentOS 7
builder/build-package fedora thirtythree builder/build-package fedora thirtythree
``` ```
# build the docker image # Build and test a package
``` ```
cd /src_code_root builder/build-and-test-deb ubuntu focal
docker build -t kasmvncbuilder:18.04 -f builder/dockerfile.ubuntu1804.build . builder/build-and-test-rpm centos core
``` ```
### Run the builder open browser and point to https://<ip-address>/
```sh
mkdir -p builder/build 3 default users are created:
docker run -v /tmp:/build --rm kasmvncbuilder:18.04 * 'foo' with default password 'foobar'. It can use mouse and keyboard.
cp /tmp/build/kasmvnc.ubuntu_18.04.tar.gz builder/build/ * 'foo-ro' with default password 'foobar'. It can only view.
* 'foo-owner' with default password 'foobar'. It can manage other users.
# Test a package
If you want to test deb/rpm package you already built, please use this:
```
builder/test-deb ubuntu focal
```
It will install the package inside a new container.
# Package development
## deb/rpm package building and testing
First, a tarball is built, and then its files are copied to deb/rpm package as
it is being built.
Package testing stage installs the deb/rpm package in a fresh docker container
and runs KasmVNC.
```
builder/build-tarball debian buster
builder/build-deb debian buster
builder/test-deb debian buster
``` ```
### Build test desktop container `build-and-test-deb` is good to do the whole dev lifecycle, but to iterate
```sh quickly, you'll need to skip building tarball (which takes a long time), and
cd builder just build your deb/rpm with `build-deb` and test with `test-deb`.
docker build -t kasmvnctester:18.04 -f dockerfile.ubuntu1804.test .
```
### run an instance of the new destkop `build-rpm` and `test-rpm` are also available.
```sh
docker run -it -p 443:8443 --rm -e "VNC_USER=username" -e "VNC_PW=password123" kasmvnctester:18.04
```
open browser and point to https://<ip-address>/vnc.html ## Ensuring packages have all dependencies they need.
The username and password were set in the docker run command
If you're working on a deb/rpm package, testing that it has all necessary
dependencies is done via testing in a barebones environment (read: no XFCE). In
this way we can be sure that runtime dependencies aren't met accidentally by
packages installed with XFCE.
```
builder/test-deb-barebones ubuntu focal
```