takelage-cli

takelage-cli is a command line interface to facilitate the takelage devops workflow. The takelage devops workflow helps devops engineers build, test and deploy os images.

The takelage-cli executable tau is a ruby command line script using the thor toolkit.

Framework

The takelage devops framework consists of these projects:

App Description
takelage-doc takelage documentation
takelage-dev takelage development environment
takelage-var takelage test plugin
takelage-cli takelage command line interface
takelage-bit takelage bit server

Installation

tau is part of takelage-dev's docker image but you typically want to install it on the host system as well. Install the takelage gem and its dependencies through the gem command line tool:

gem install takelage

Commands

takelage-cli uses cucumber to system test its features. You are encouraged to read the cucumber feature files for the tau commands to get an idea of how the commands work. You can list the tau commands by running tau self list or tau list:

Command Description
tau bit check workspace Check if a bit workspace exists
tau bit clipboard copy [DIR] [SCOPE] Copy new [DIR] to [SCOPE]
tau bit clipboard paste [COMPONENT] [DIR] Paste bit [COMPONENT] into [DIR]
tau bit clipboard pull Pull all updates for bit components from bit remote scopes
tau bit clipboard push Push all updates of bit components to bit remote scopes
tau bit scope add [SCOPE] Add a bit [SCOPE]
tau bit scope inbit Log in to bit remote server
tau bit scope list List bit remote scopes
tau bit scope new [SCOPE] Init a new bit [SCOPE]
tau completion bash Print bash completion code
tau docker check running Check if docker daemon is running
tau docker container check existing [CONTAINER] Check if docker [CONTAINER] is existing
tau docker container check network [NETWORK] Check if docker [NETWORK] is existing
tau docker container check orphaned [CONTAINER] Check if docker [CONTAINER] is orphaned
tau docker container command [CMD] Run [CMD] in a docker container
tau docker container daemon Run docker container in daemon mode
tau docker container login Log in to latest local docker container
tau docker container nuke Remove all docker containers
tau docker container purge Remove orphaned docker containers
tau docker image check outdated Check if a docker image is outdated
tau docker image tag check local [TAG] Check if local docker image [TAG] exists
tau docker image tag check remote [TAG] Check if remote docker image [TAG] exists
tau docker image tag latest local Print latest local docker image tag
tau docker image tag latest remote Print latest remote docker image tag
tau docker image tag list local Print local docker image tags
tau docker image tag list remote Print remote docker image tags
tau docker image update Get latest remote docker container
tau docker socket host Print docker socket host ip address
tau docker socket scheme Print docker socket scheme
tau docker socket start Start sockets for docker container
tau docker socket stop Stop sockets for docker container
tau git check clean Check if the git workspace is clean
tau git check master Check if we are on the git master branch
tau git check workspace Check if a git workspace exists
tau info project active Print active project info
tau info project main Print main project info
tau info project private Print private project info
tau self config active Print active takelage configuration
tau self config default Print takelage default configuration
tau self config home Print takelage home config file configuration
tau self config project Print takelage project config file configuration
tau self list List all commands
tau self version Print tau semantic version number
tau config Alias for tau self config active
tau copy [DIR] [SCOPE] Alias for tau bit clipboard copy
tau list Alias for tau self list
tau login Alias for tau docker container login
tau nuke Alias for tau docker container nuke
tau paste [COMPONENT] [DIR] Alias for tau bit clipboard paste
tau project Alias for tau info project active
tau pull Alias for tau bit clipboard pull
tau purge Alias for tau docker container purge
tau push Alias for tau bit clipboard push
tau update Alias for tau docker image update
tau version Alias for tau self version

Warning: tau update will call docker image prune and remove all dangling images!

Configuration

Configuration Files

takelage-cli uses three different YAML configuration files which have different precedences. They are merged to an active configuration during runtime which can be inspected with tau self config active or tau config.

Filename Precedence Description
default.yml lowest Shipped with takelage-cli. Sets defaults where applicable.
~/.takelage.yml normal User-wide configuration file in your home directory. This is your normal custom configuration file.
takelage.yml highest Project-specific configuration file next to your main Rakefile. Some projects need special configuration.

Configuration Examples

  • You should add the following configuration items in your ~/.takelage.yml if you want to use a private bit remote server:
---
bit_remote: 'ssh://[email protected]:222:/bit'
bit_ssh: 'ssh -p 222 [email protected]'
  • By default, takelage uses bright prompt colors which are best viewed on a dark background. If you prefer a light background (or want less bright colors) you can add an option to your ~/.takelage.yml:
---
docker_daynight: 'day'
  • If you want to pin a specific docker tag for one of your projects then create an takelage.yml file with:
---
docker_tag: '1.2.3'
  • The cucumber tests make use of an ~/.takelage.yml to overwrite defaults like:
---
docker_repo: takelage-mock

Furthermore, every external command can be reconfigured.

Project Files

tau reads two different YAML project files which have different precedences. They are merged to an active configuration during runtime which can be inspected with tau info project active or tau project.

Default filename Config key Precedence Description
project.yml info_project_main normal Main project file.
private/project.yml info_project_private highest Private project file. Should be in .gitignore.

Bash Completion

Add this to your bash startup files:

source <(tau completion bash)

Software Tests

takelage-cli ships with cucumber ruby tests. It uses cucumber's aruba extension and especially its filesystem library.

takelage-cli deploys a private docker registry to conduct end-to-end tests of tau docker commands. The registry exposes port 5005. You need to whitelist it in your host's docker engine configuration:

{
  "insecure-registries": [
    "host.docker.internal:5005"
  ]
}

takelage-cli deploys a bitboard server created with takelage-bit to end-to-end test the tau bit commands.