paashup-cli
paashup-cli is a command-line tool for managing your paashup environment, including Docker containers, hosts, images, and Netbox configurations. This tool provides various commands to list, inspect, start, stop, and execute operations on Docker containers, as well as managing Docker hosts, images, and Netbox configurations.
Build
using docker:
docker run -it --rm -v ./:/go golang:1.22 go build -buildvcs=false -ldflags "-X main.version=<VERSION> -X main.PLATFORM_URL=<PLATFORM_URL> -X main.PLATFORM_PUB_KEY=<PUB_KEY>" -o bin/ ./...
Installation
To install paashup-cli, ensure you have Go installed and run:
go get github.com/saashup/paashup-cli
Setup
First you need to define the netbox source:
paashup-cli netbox set-config name http://netbox.local mytoken
For autocompletion, download the completion script (autocompletion.bash) and then source it like this:
PROG=paashup-cli source autocompletion.bash
Documentation Generation
For Stack jsonschema generation, you can use the following command:
paashup-cli doc jsonschema
Usage
paashup-cli provides multiple commands categorized under platforms, Docker resources, Netbox configurations, and stack deployments.
Global Flags
--format, -f: Choose between yaml, json, or json-pretty formats. Default is json.
Commands Overview
The CLI is structured with several main commands, each with its own set of subcommands.
Manage platforms within your paashup environment.
-
Create an Account
paashup-cli platform account create <username> <password>
Creates a new account. Example:
paashup-cli platform account create user1 password123
-
Login in Platform
paashup-cli platform login <username> <password>
-
Initialize a Platform
paashup-cli platform init
Initializes a platform. Example:
paashup-cli platform init
-
List Platforms
paashup-cli platform ls
2. Netbox Commands
Manage Netbox configurations for your paashup environment.
-
Set Netbox Configuration
paashup-cli netbox set-config NAME NETBOX_URL NETBOX_TOKEN
Sets a Netbox configuration. Example:
paashup-cli netbox set-config myconfig http://netbox.example.com token123
-
Use Netbox Configuration
paashup-cli netbox use NAME
Selects a Netbox configuration by name. Example:
paashup-cli netbox use myconfig
3. Stack Commands
Manage and deploy stacks.
-
Deploy a Stack
paashup-cli stack deploy YAMLFILE
Deploys a stack from a YAML file. Example:
paashup-cli stack deploy stack.yaml
4. Docker Commands
Manage Docker resources including containers, hosts, images, volumes, and registries.
Example Workflows
Set Up a New Environment
-
Set Netbox Configuration
paashup-cli netbox set-config myconfig http://netbox.example.com token123
-
Initialize a Platform
paashup-cli platform init
-
Deploy a Stack
paashup-cli stack deploy stack.yaml
Manage Docker Containers
-
List All Containers
paashup-cli docker container ls
-
Start a Container
paashup-cli docker container start --nowait myhost mycontainer
-
Get Logs from a Container
paashup-cli docker container logs myhost mycontainer
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License. See the LICENSE file for details.