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.
takelage-cli is also the remote control for the takelship.
The takelage-cli executable ship
is a wrapper for tau ship
.
Framework Versions
Project | Artifacts |
---|---|
Framework Status
Project | Pipelines |
---|---|
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 takeltau
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 commands or tau commands:
Command | Description |
---|---|
tau completion bash | Print bash completion code |
tau docker check daemon | 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 clean | Remove all docker containers |
tau docker container command [CMD] | Run [CMD] in a docker container |
tau docker container daemon | Run docker container in daemon mode |
tau docker container list | List docker containers |
tau docker container login | Log in to latest local docker container |
tau docker container prune | Remove orphaned docker containers |
tau docker image tag check [TAG] | Check if local docker image [TAG] exists |
tau docker image tag latest | Print latest local docker image tag |
tau docker image tag list | Print local docker image tags |
tau docker image update | Get latest remote docker container |
tau git check clean | Check if the git workspace is clean |
tau git check hg | Check if we are on the git hg branch |
tau git check workspace | Check if a git workspace exists |
tau hg list | List hg repos |
tau hg pull | Pull hg repos |
tau hg push | Push hg repos |
tau info project active | Print active project info |
tau info project dir | Print project root directory |
tau info project main | Print main project info |
tau info project private | Print private project info |
tau info status bar | Print status bar |
tau info status arch | Check arch status |
tau info status git | Check git status |
tau info status gopass | Check gopass status |
tau info status gpg | Check gpg status |
tau info status hg | Check hg status |
tau info status mutagen | Check mutagen status |
tau info status ssh | Check ssh status |
tau init packer docker | Initialize packer project for docker images |
tau init takelage rake | Initialize takelage rake project |
tau mutagen check daemon) | Check if mutagen host conenction is available |
tau mutagen socket check [SOCKET] | Check if mutagen [SOCKET] exists |
tau mutagen socket create [NAME] [IN] [OUT] | Create a mutagen socket [NAME] from [IN] to [OUT] of the container |
tau mutagen socket list | List mutagen sockets |
tau mutagen socket terminate [SOCKET] | Terminate a mutagen [SOCKET] |
tau mutagen socket tidy | Remove mutagen daemon files |
tau self commands | List all commands |
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 config envvars | Print env vars takeltau configuration |
tau self version | Print tau semantic version number |
tau ship completion bash | Print bash completion code for ship subcommand |
tau ship container check existing | Check if a takelship is existing |
tau ship container clean | Stop all takelships |
tau ship container command [CMD] | Run a bash command in a takelship container |
tau ship container list | List takelships |
tau ship container hostname | Print takelship hostname |
tau ship container login | Log in to a takelship |
tau ship container logs [ARGS] | Print the takelship logs |
tau ship container name | Print the takelship name |
tau ship container podman [CMD] | Run a podman command in a takelship |
tau ship container shipdir | Print takelship shipdir |
tau ship container stop | Stop a takelship |
tau ship container sudo [CMD] | Run a sudo command in a takelship |
tau ship container update | Update takelship image |
tau ship info takelconfig | Print takelage config |
tau ship info takelship | Print takelship info |
tau ship info version | Print ship version |
tau ship project create [PROJECT] | Create a takelship [PROJECT] |
tau ship project list | List takelship projects |
tau ship project restart [PROJECT] | Restart a takelship [PROJECT] |
tau ship project start [PROJECT] | Start a takelship [PROJECT] |
tau ship project stop | Stop a takelship project |
tau ship project update [PROJECT] | Update a takelship [PROJECT] |
tau ship board | Alias for tau ship container login |
tau ship clean | Alias for tau ship container clean |
tau ship command [CMD] | Alias for tau ship container command |
tau ship docker [CMD] | Alias for tau ship container podman |
tau ship list | Alias for tau ship container list |
tau ship login | Alias for tau ship container login |
tau ship logs [ARGS] | Alias for tau ship container logs |
tau ship ls | Alias for tau ship container list |
tau ship name | Alias for tau ship container list |
tau ship podman [CMD] | Alias for tau ship container podman |
tau ship sail [PROJECT] | Alias for tau ship project start |
tau ship restart [PROJECT] | Alias for tau ship project restart |
tau ship start [PROJECT] | Alias for tau ship project start |
tau ship stop | Alias for tau ship project stop |
tau ship sudo [CMD] | Alias for tau ship container sudo |
tau ship wreck | Alias for tau ship project stop |
tau ship update | Alias for tau ship container update |
tau ship version | Alias for tau ship info version |
tau clean | Alias for tau docker container clean |
tau commands | Alias for tau self commands |
tau config | Alias for tau self config active |
tau list | Alias for tau docker container list |
tau ls | Alias for tau docker container list |
tau login | Alias for tau docker container login |
tau project | Alias for tau info project active |
tau prune | Alias for tau docker container prune |
tau status | Alias for tau docker info status bar |
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 and environment variables 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. |
TAKELAGE_TAU_CONFIG_* | ultimate | Fileless configuration through TAKELAGE_TAU_CONFIG environment variables. |
The tau command line tool is directory-aware so it is important that you can set the working directory of the tau command. The project directory is identified by precedence:
Method | Precedence |
---|---|
Current working directory | lowest |
Main Rakefile
|
normal |
TAKELAGE_WORKDIR environment variable |
highest |
--workdir /-w command line option |
ultimate |
Configuration Examples
- You should add the following configuration items in your ~/.takelage.yml if you want to use the takelbeta docker image channel:
---
docker_repo: takelbeta
- 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
- You may prefer to interact with
mercurial
through
tau hg
in a different branch thanmain
in one project so you may add to your takelage.yml:
---
git_hg_repo: my_git_hg_branch
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)
and/or
source <(ship completion bash)
Software Tests
takelage-cli uses minitest unit tests.
takelage-cli ships with cucumber ruby system 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"
]
}