a flexible and extensible automation framework
The framework is written in bash
.
It runs wherever bash
version 4 installed.
We have tested it on
-
Ubuntu 14/16/18
-
Debian 3
-
Raspian (on PI model B and B+)
-
Cygwin on Windows 7 and 10
-
Windows 10 WSL with Ubuntu 18 installed
-
Mac OS X
The easiest way to install the framework is using apt
and the PPA distribution:
sudo add-apt-repository ppa:vdmeer/skb
sudo apt-get update
sudo apt-get install skb-framework
For other installation options, please see the Installation section in the User Guide.
The SKB-Framework provides a flexible, metadata-driven automation framework. Its main objective is to load and provide flexible access to tasks. A task is a shell script with additional semantics (metadata) processed by the framework. These additional semantics allow the framework to take care of some common functions for defined tasks, for example loading and evaluating parameters and dependencies.
The framework itself provides a start script, a loader, and an interactive shell. The start script sets initial parameters, such as name, acronym for name, path to an installation. The loader will process specifications (mainly tasks) and validate them. Once the loader is satisfied, it will start the interactive shell.
An application using the framework can be started in one of three different modes:
dev
for a development mode,
build
for a build mode, and
use
for a use mode.
The development mode dev
should load tasks required to develop an application.
The build mode build
should load tasks required to build artifacts for a given application.
The use mode use
should load tasks required to use built artifacts for a given application.
An application can also run in two different flavors:
std
or standard for the standard flavor, and
install
for the installation flavor.
Almost all tasks are visible in the std
flavor.
Only specific tasks, required when installing an application, are limited to the install
flavor.
The framework provides definitions for seven different elements: tasks, their dependencies, their (configuration) parameters, application CLI options, shell commands, application error codes, and scenarios. The framework loader will load all those definitions and validate them based on the provided metadata. CLI options, commands, and error codes are handled by the framework itself. Tasks, dependencies, parameters, and scenarios can be defined by an application. This framework provides a basic set of tasks, dependencies, and parameters. It also defines some scenarios to build its own deployment artifacts.
This software package also provides an application named skb-framework
as a standard application utilizing the framework’s features and tasks.
For more information on the framework, how to use it, how to build software artifacts, and how develop your own application with it, please visit the SKB-Framework website at https://vdmeer.github.io/skb/framework/.
The framework is written in bash
.
It uses associative arrays, also known as hash maps.
Thus version 4 or higher of bash
is required.
There are a few other requirements to start the framework, listed in the table below. These requirements are for the framework (start script, loader, interactive shell, and API). All of them are tested during the application load, i.e. before the interactive shell is started.
Dependency | Description |
---|---|
|
The Bash shell version 4 or higher. On most UNIX/Linux system, Bash 4 will be part of a standard installation. |
(GNU) |
The framework requires command line parsing for its own CLI arguments as well for every task.
It uses the GNU enhanced version of |
|
Program to print formatted date and time information, or to get time stamps. It is used to create time stamps. |
|
Program to strip the last component of a file name, leaving a path. It is used to set several paths for the framework. |
|
Get the current working directory. It is used to generate several paths for the framework. |
|
Prints system information. It is used to determine the operating system the framework is running in, for some low level functions. |
|
Tool to remove sections from each line in a file or a string. It is used to parse strings, for instance the result of uname. |
|
This standard tool concatenates files and prints them to the standard output. It is used for instance to read the version files. |
|
Creates directories, used to create temporary and target directories. |
|
This is an arbitrary precision calculator (language and application).
It is used here to calculate the execution time of tasks and scenarios (since Bash does not offer floating point arithmetic).
See also the GNU manual page. |
(GNU) |
The framework needs to create a temporary directory with runtime configuration files.
It uses See also the GNU page. |
|
Lists directories and files, used to test the contents of temporary directories. |
|
Counts several properties of files or strings, used to test temporary directories. |
|
This tool can be used to initialize a terminal or to query the terminal database (terminfo).
The |
|
As the manual states: "less is the opposite of more".
It essentially allows to show a file and move backwards and forwards, search the content, and more interactions.
The |
|
Removes files, used to clean temporary and target directories. |
|
Sorts lines of text files as well as other input. It is used in several places to sort the keys of associative arrays alphabetically. |
Most of the tested dependencies are standard UNIX tools and programs, available on any given server or client installation. The reason to test them before starting the shell is that the framework (or an application) can also be deployed in the cloud or inside a container. There is no guarantee that the operating system in these environments actually provide all required the programs (external dependencies). So we have to test them all.
Tasks can define any other dependency to external applications and tools. Task dependencies are tested separately, when tasks are loaded.
The framework is released in a few different formats, at a few different sites, all simultaneously (on the same day). The main release happens on a Ubuntu PPA on Launchpad. Then DEB and RPM files are released to Bintray. Finally, DEB, RPM, and TGZ files are released on Github. All releases are from the same original build, they might differ in some features (such as pre/post install automation).
Site | Links | Description |
---|---|---|
Launchpad |
This is the PPA and main release of the framework. Strict rules apply to packages here and they are checked at submission by Launchpad. |
|
Bintray |
I use Bintray for binary releases of DEB and RPM files. You can find both of them here. |
|
Github |
When a new version is tagged on Github (source directory, after successful deployment on Launchpad and Bintray), the DEB and RPM files are also released here. This location provides two more release files:
|
Item | Link(s) | Description |
---|---|---|
Website |
the framework’s website with all information that has been produced |
|
Source |
the software sources, in a Github repository, everything is here |
|
Issues |
please look here for any issues, and if your issue or feature is not discussed already, then please add it! |
|
Manual |
The framework’s manual page with the same content as the manual in the package and the manpage |
|
User Guide |
details how to install and use the framework |
|
Task Guide |
complete guide for all provided tasks |
|
Developer Guide |
only if you are not afraid to see and use |