8000 GitHub - goodylabs/tug · GitHub
[go: up one dir, main page]

Skip to content
  • Pricing
  • Sign up
    goodylabsPublic

    About

    No description, website, or topics provided.

    Resources

    Stars

    2 stars

    Watchers

    0 watching

    Forks

    Latest commit

     

    History

    168 Commits

    Folders and files

    Repository files navigation

    TUG

    tug

    The main idea

    TUG makes common server operations more easy

    each TUG server cmd (docker, swarm, pm2, pystrano) consists of 2 steps:

    1. loading server connection config
    2. making actions on server you selected

    Example flow:

    1. tug docker
    2. select environment (example: stg)
    3. select host
    4. select select action
    5. if action requires resource, select resource
    6. step back using ctrl + c
    7. step back using ctrl + c

    Demo video:

    tug-docker.3.mp4

    Navigation

    • chose option: arrow keys + Enter
    • search: "/" + type phrase
    • go back: ctrl + c

    Installation

    1. Install jq

    brew install jq      # macOS
    sudo apt install jq  # Ubuntu
    sudo pacman -S jq    # Arch Linux
    sudo dnf install jq  # Red Hat/CentOS

    2. Prepare your environment

    bash/zsh

    rc_file=${HOME}/.$(basename "$SHELL")rc
    echo 'export PATH="$HOME/.tug/bin:$PATH"' >> $rc_file
    source $rc_file

    fish

    set rc_file $HOME/.(basename $SHELL)rc
    echo 'set -gx PATH $HOME/.tug/bin $PATH' >> $rc_file
    source $rc_file

    3. Install TUG

    curl -s https://raw.githubusercontent.com/goodylabs/tug/refs/heads/main/scripts/download.sh | bash -s

    4. Check TUG version

    tug --version

    5. Configure TUG for ssh connections

    tug configure

    Commands

    tug docker

    Docker

    Config source: variable in script ./devops/*/deploy.sh

    TARGET_IP    (string)
    IP_ADDRESS   (string)
    IP_ADDRESSES ([]string)
    
    # Examples
    TARGET_IP=192.168.1.100
    IP_ADDRESS=192.168.1.100
    IP_ADDRESSES=(192.168.1.100 192.168.1.101)

    Available actions

    Swarm (Docker)

    Config source: same as Docker

    Available actions

    PM2

    Config source: ./ecosystem.config.js or ./ecosystem.config.cjs

    Available actions

    Flag --host

    Instead of reading config directly from pm2 / docker project you can manually specify host using --host flag and then optionally --user flag.

    tug docker --host 123.23.7.254 # (default user: root) 
    tug docker --host 123.23.7.254 --user ubuntu

    About

    No description, website, or topics provided.

    Resources

    Stars

    2 stars

    Watchers

    0 watching

    Forks

    Releases

    Packages

    Contributors

    Languages

    0