Developer Guide

Deploy for development

This project uses pip to manage the package. If you want to work on the project yourself you can create the necessary links via:

$ pip3 install --user -e .

That will install a backlink ~/.local/bin/kas to this project. Now you are able to call it from anywhere.

Docker image build

Just run:

$ docker build -t <image_name> .

When you need a proxy to access the internet, add:

--build-arg http_proxy=<http_proxy> --build-arg https_proxy=<https_proxy> --build-arg ftp_proxy=<ftp_proxy> --build-arg no_proxy=<no_proxy>

to the call.

Class reference documentation

kas.kas Module

kas.libkas Module

This module contains the core implementation of kas.

class kas.libkas.LogOutput(live)[source]

Handles the log output of executed applications

log_stderr(line)[source]

This method is called when a line is received over stderr.

log_stdout(line)[source]

This method is called when a line is received over stdout.

kas.libkas.find_program(paths, name)[source]

Find a file within the paths array and returns its path.

kas.libkas.get_build_environ()[source]

Creates the build environment variables.

kas.libkas.kasplugin(plugin_class)[source]

A decorator that registers kas plugins

kas.libkas.repos_apply_patches(repos)[source]

Applies the patches to the repositories.

kas.libkas.repos_fetch(repos)[source]

Fetches the list of repositories to the kas_work_dir.

kas.libkas.run_cmd(cmd, cwd, env=None, fail=True, liveupdate=True)[source]

Runs a command synchronously.

kas.libkas.run_cmd_async(cmd, cwd, env=None, fail=True, liveupdate=True)[source]

Run a command asynchronously.

kas.libkas.ssh_add_key(env, key)[source]

Adds an ssh key to the ssh-agent

kas.libkas.ssh_cleanup_agent()[source]

Removes the identities and stops the ssh-agent instance

kas.libkas.ssh_no_host_key_check()[source]

Disables ssh host key check

kas.libkas.ssh_setup_agent(envkeys=None)[source]

Starts the ssh-agent

kas.libcmds Module

kas.build Module

kas.shell Module

kas.config Module

kas.repos Module

This module contains the Repo class.

class kas.repos.GitRepo(url, path, refspec, layers, patches, disable_operations)[source]

Provides the git functionality for a Repo.

class kas.repos.MercurialRepo(url, path, refspec, layers, patches, disable_operations)[source]

Provides the hg functionality for a Repo.

class kas.repos.Repo(url, path, refspec, layers, patches, disable_operations)[source]

Represents a repository in the kas configuration.

static factory(name, repo_config, repo_fallback_path)[source]

Returns a Repo instance depending on params.

static get_root_path(path, fallback=True)[source]

Checks if path is under version control and returns its root path.

class kas.repos.RepoImpl(url, path, refspec, layers, patches, disable_operations)[source]

Provides a generic implementation for a Repo.

apply_patches_async()[source]

Applies patches to a repository asynchronously.

checkout()[source]

Checks out the correct revision of the repo.

fetch_async()[source]

Starts asynchronous repository fetch.

kas.includehandler Module