From e7f8caa752b9f9d4e89fe747b842087eee15461f Mon Sep 17 00:00:00 2001 From: Dmitry Maksyoma Date: Tue, 13 Apr 2021 22:47:10 +1200 Subject: [PATCH] Building: describe how to build and test packages --- builder/README.md | 68 ++++++++++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 24 deletions(-) diff --git a/builder/README.md b/builder/README.md index 56c5e8b..34a5e31 100644 --- a/builder/README.md +++ b/builder/README.md @@ -1,12 +1,6 @@ ## REQIUREMENTS 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 ``` # builder/build-package @@ -22,29 +16,55 @@ builder/build-package centos core # CentOS 7 builder/build-package fedora thirtythree ``` -# build the docker image +# Build and test a package ``` - cd /src_code_root - docker build -t kasmvncbuilder:18.04 -f builder/dockerfile.ubuntu1804.build . +builder/build-and-test-deb ubuntu focal +builder/build-and-test-rpm centos core ``` -### Run the builder -```sh - mkdir -p builder/build - docker run -v /tmp:/build --rm kasmvncbuilder:18.04 - cp /tmp/build/kasmvnc.ubuntu_18.04.tar.gz builder/build/ -``` +open browser and point to https:/// + +3 default users are created: +* 'foo' with default password 'foobar'. It can use mouse and keyboard. +* 'foo-ro' with default password 'foobar'. It can only view. +* 'foo-owner' with default password 'foobar'. It can manage other users. -### Build test desktop container -```sh - cd builder - docker build -t kasmvnctester:18.04 -f dockerfile.ubuntu1804.test . +# 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 -### run an instance of the new destkop -```sh -docker run -it -p 443:8443 --rm -e "VNC_USER=username" -e "VNC_PW=password123" kasmvnctester:18.04 +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 ``` -open browser and point to https:///vnc.html -The username and password were set in the docker run command +`build-and-test-deb` is good to do the whole dev lifecycle, but to iterate +quickly, you'll need to skip building tarball (which takes a long time), and +just build your deb/rpm with `build-deb` and test with `test-deb`. + +`build-rpm` and `test-rpm` are also available. + +## Ensuring packages have all dependencies they need. + +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 +```