/cli

The convenient command line interface (CLI) to the unikube platform. :computer:

Primary LanguagePythonApache License 2.0Apache-2.0

Build Status Quality Gate Status Coverage Status Code style: black Unikube Slack Community

The Unikube CLI

This is the command line interface for unikube.

Documentation

The unikube cli documentation is automatically built.

Installation

General

The unikube cli can be installed via pip. Please make sure you are using Python 3.

pip install unikube

MacOS

The unikube cli is also installable via brew:

brew tap unikubehq/tooling
brew install unikubehq/tooling/unikube

Make Local

cd docs
make html

Development


Setup

Start the local unikube development cluster:

k3d cluster start unikube

Install CLI

To install the latest (pre-)release of the Unikube CLI type

sudo pip3 install unikube==<VERSION> --upgrade --pre

Enable tab completion

unikube support tab completion scripts for bash.

unikube system completion bash > /etc/bash_completion.d/unikube.bash-completion

You probably need to restart your shell in order for the completion script to do its work.

Virtual Environment + Requirements

Create virtual environment:

python -m .venv venv

Install requirements (production + development):

pip3 install -r requirements.txt -r requirements.dev.txt

Version Build + Release

Version management is handled via bump2version.

bump2version patch|minor|major

Increase dev version (e.g.: 1.0.0-dev1 -> 1.0.0-dev2):

bump2version build

Create release (e.g.: 1.0.0-dev2 -> 1.0.0):

bump2version release

Test


Tests for the unikube cli are developed using the pytest framework in combination with the click.testing module.

Thus, it is possible to run the tests using pytest or by configuring the testing environment/options within your IDE to use pytest.

Currently, most tests are developed directly against the unikube API, using a test-account. Therefore, it is required to provide the credentials via the following environment variables:

TESTRUNNER_EMAIL=...
TESTRUNNER_SECRET=...

Otherwise, tests might fail locally, even if they are correct.

It is possible to set the environment variables using an .env file within your virtual environment or by providing them explicitly:

TESTRUNNER_EMAIL=... TESTRUNNER_SECRET=... pytest