Git Product home page Git Product logo

ctcli's Introduction

ctcli - CraftTalk Command Line Tool

Actions Status codecov

Commands

help

Shows help

version

Shows version

init

Initializes specified root directory as a ctcli dir.

ctcli --root /path/to/dir init

install

Installs a package into specified root folder. Example:

ctcli install /path/to/package.tar.gz

First it creates tmp dir and extracts an archive. Then it creates oci image config and rootfs folder. Then it copies unpacked images to current-release folder. Makes symlinks for logs folder and configs. Creates a zero backup.

upgrade

Upgrades a release with binaries contained in given package. Backups previous release. Example:

ctcli upgrade /path/to/package.tar.gz

Creates a tmp dir and extracts the archive. Then it creates oci image configs and rootfs folders. Next it checks diff between apps in package and apps in current release and prompts for upgrade. If user decided to upgrade, creates a backup, deletes apps from current release and copies files from tmp folder to current release.

delete

Deletes a release completely. Example:

ctcli delete

start

Starts current installation. Example:

ctcli start [app]

stop

Stops current installation. Example:

ctcli stop [app]

logs

Shows logs (stdout/stderr) of specified service. Example:

ctcli logs [--tail <n>] [-f] <app>

Options:

  • --tail 100 - Show latest 100 bytes
  • -f - Follow log file

status

Show current status. Example:

ctcli status

exec

Execute a command inside a container. Example:

ctcli exec busybox cat /etc/hosts

backup

Makes an archive containing current-release/, data/ and config/ folders and puts it into releases/ folder

  • --ignore-data flag disables data/ folder backup
ctcli backup [--ignore-data]

release-info

Shows current release app list and each app version

ctcli release-info

rollback

Install previous release

ctcli rollback /path/to/archive.tar.gz

To Be Done

list-releases

Shows full list of releases and highlights current release.

ctcli list-releases

Root Directory File Structure

/releases           - Previous releases and etc.
/config             - Services' configs
/current-release    - Current installation
/logs               - Logs
/data               - app persistent data
/runc-root          - runc containers root dir 
/tmp                - Temporary directory

Package structure

meta.json   - contains PackageMeta object and has commitSha, imageTag and etc
package/    - contains package content
    ./runc.amd64    - runc binary
    ./umoci.amd64   - umoci binary
    ./apps          - apps in container
        ./{app}     - app in package
            ./package-config.json   - contains AppPackageConfig object
            ./version.json          - contains info about app image version 
            ./skopeo                - contains oci image that umoci will then extract

Backups

Backup is an archive and has following structure:

/config     - app configs
/apps       - apps
/data

ctcli's People

Contributors

dbarbashov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.