A small script I use when working with Univention Corporate Server (UCS). UCS is a Debian based operating system. Developing and testing software usually involves working on a VM where UCS is deployed. Anyways, editing files remotely then copying them back to my local machine in order to check them into version control was a nasty workflow. So I decided to go the other way around: edit locally and distribute the files to the VMs.
The script is easy to use and can be configured using environment variables via direnv. You have to provide Docker image, a directory where packages should be build and a target machine:
usage: update_package.py [-h] [-l {CRITICAL,ERROR,WARNING,INFO,DEBUG}] [--repository-root REPOSITORY_ROOT] [-i IMG] {build_and_update,bu,drop_to_build_env,dbe} ...
Build and update packages. Build packages for each FOLDER, copy them over to the given MACHINES and update them. Package buildings is done via Docker. Note that packages are only updated, i.e. if they are not installed the package will not be installed on the target machine. You can skip the check if the package is installed using "-c". The script is supposed to run anywhere in a git repository and FOLDER has to be relative to the root of the repo.
positional arguments:
{build_and_update,bu,drop_to_build_env,dbe}
sub-commands
options:
-h, --help show this help message and exit
-l {CRITICAL,ERROR,WARNING,INFO,DEBUG}, --log-level {CRITICAL,ERROR,WARNING,INFO,DEBUG}
Set the levels of logging which should get printed to stdout. The lower the more messages you will see. Default: 20.
--repository-root REPOSITORY_ROOT
The root of the repository. By default the root is searched by walking up the filetree until the `.git' directory is found.
-i IMG, --docker-image IMG
Use IMG to build packages. You can also set this argument via the "UP_DOCKER_IMAGE" environment variable.
These are the configured predefined sets of machines:
single: bsbt1