All Projects → roots → trellis-cli

roots / trellis-cli

Licence: MIT license
A CLI to manage Trellis projects

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to trellis-cli

Trellis
WordPress LEMP stack with PHP 8.0, Composer, WP-CLI and more
Stars: ✭ 2,295 (+1527.66%)
Mutual labels:  trellis, trellis-cli
gardener
Lazy configuration of Roots stack (Trellis/Bedrock/Sage/Soil) based on command-line prompts.
Stars: ✭ 27 (-80.85%)
Mutual labels:  trellis, roots
trellis-database-uploads-migration
Ansible playbook for Trellis that manages database and uploads migration.
Stars: ✭ 95 (-32.62%)
Mutual labels:  trellis
wp-smtp
Simple package for handling WordPress SMTP with .env when using the Roots stack.
Stars: ✭ 31 (-78.01%)
Mutual labels:  roots
trellis-sync
Trellis Database and Uploads Folder Synchronisation scripts and example WP CLI Aliases
Stars: ✭ 27 (-80.85%)
Mutual labels:  trellis
sage-xpress
A collection of Roots/Sage 9.x-beta providers for rapid theme development. Xpress adds configurable app-like functionality to the Sage Container.
Stars: ✭ 26 (-81.56%)
Mutual labels:  roots
bedrock-site-protect
Ansible role: Add htpasswd protection to Trellis (Bedrock-Ansible) WordPress sites.
Stars: ✭ 79 (-43.97%)
Mutual labels:  trellis
tiny-blocks
WordPress block editor framework
Stars: ✭ 31 (-78.01%)
Mutual labels:  roots
acorn-db
Provides Acorn projects with Eloquent Models for WordPress data.
Stars: ✭ 30 (-78.72%)
Mutual labels:  roots
Root-Finder
Root-Finder is a header-only univariate polynomial solver, which finds/counts all real roots of any polynomial within any interval.
Stars: ✭ 30 (-78.72%)
Mutual labels:  roots
tiller-circleci
Deploy Trellis, Bedrock and Sage via CircleCI
Stars: ✭ 14 (-90.07%)
Mutual labels:  trellis
susa
High Performance Computing (HPC) and Signal Processing Framework
Stars: ✭ 55 (-60.99%)
Mutual labels:  trellis
enveigle
Deceive Ansible to template Trellis .env files to local Bedrock
Stars: ✭ 18 (-87.23%)
Mutual labels:  trellis
tiller
Deploy Trellis, Bedrock and Sage via AWS CodeBuild
Stars: ✭ 19 (-86.52%)
Mutual labels:  trellis
trellis-backup-during-deploy
Backup WordPress database during Trellis deploys
Stars: ✭ 23 (-83.69%)
Mutual labels:  trellis
tiller-circleci-orb
Deploy Trellis, Bedrock and Sage(optional) via CircleCI
Stars: ✭ 13 (-90.78%)
Mutual labels:  trellis
built-with-roots
Demo of a fan site of WordPress sites built with Roots, which is also built with Roots
Stars: ✭ 19 (-86.52%)
Mutual labels:  roots
wp-docker-bedrock
[UNSUPPORTED] Roots Bedrock for WordPress running on Docker.
Stars: ✭ 50 (-64.54%)
Mutual labels:  roots
wp-config
Bedrock's failsafe wp-config
Stars: ✭ 45 (-68.09%)
Mutual labels:  roots

trellis-cli

Build status GitHub release

A command-line interface (CLI) to manage Trellis projects via the trellis command. It includes:

  • Smart autocompletion (based on your defined environments and sites)
  • Automatic Virtualenv integration for easier dependency management
  • Easy DigitalOcean droplet creation
  • Better Ansible Vault support for encrypting files

Sponsors

trellis-cli is an open source project and completely free to use.

However, the amount of effort needed to maintain and develop new features and products within the Roots ecosystem is not sustainable without proper financial backing. If you have the capability, please consider sponsoring Roots.

Sponsor Roots

KM Digital Carrot C21 Redwood Realty WordPress.com Pantheon

Quick Install (macOS and Linux via Homebrew)

brew install roots/tap/trellis-cli

Quick Install (Unstable - macOS and Linux via Homebrew)

# Cleanup previous versions (if installed)
brew uninstall roots/tap/trellis-cli

# Install
brew install --HEAD roots/tap/trellis-cli-dev

# Upgrade
brew upgrade --fetch-HEAD roots/tap/trellis-cli-dev

Script

We also offer a quick script version:

# You might need sudo before bash
curl -sL https://roots.io/trellis/cli/get | bash

# Turns on debug logging
curl -sL https://roots.io/trellis/cli/get | bash -s -- -d

# Sets bindir or installation directory, Defaults to '/usr/local/bin'
curl -sL https://roots.io/trellis/cli/get | bash -s -- -b /path/to/my/bin

Manual Install

trellis-cli provides binary releases for a variety of OSes. These binary versions can be manually downloaded and installed.

  1. Download the latest release or any specific version
  2. Unpack it (tar -zxvf trellis_1.0.0_Linux_x86_64.tar.gz)
  3. Find the trellis binary in the unpacked directory, and move it to its desired destination (mv trellis_1.0.0_Darwin_x86_64/trellis /usr/local/bin/trellis)
  4. Make sure the above path is in your $PATH

Windows Install

For windows you also need to setup environment variables to perfectly work with windows terminal

  1. Open system properties
  2. Open environment variables
  3. Under system variables add new variable, TRELLIS, pointing to the location of the trellis.exe file, like C:\trellis_1.0.0
  4. Edit path from system variables and add new named %TRELLIS%
  5. Save the changes

Shell Integration

Autocompletes

Homebrew installs trellis-cli's shell completion automatically by default. If shell completions aren't working, or you installed manually not using Homebrew, you'll need to install the completions manually.

To use the trellis-cli's autocomplete via Homebrew's shell completion:

  1. Follow Homebrew's install instructions https://docs.brew.sh/Shell-Completion

    Note: For zsh, as the instructions mention, be sure compinit is autoloaded and called, either explicitly or via a framework like oh-my-zsh.

  2. Then run:

    brew reinstall trellis-cli

To install shell completions manually, run the following:

trellis --autocomplete-install

It should modify your .bash_profile, .zshrc or similar.

Virtualenv

trellis-cli uses Virtualenv to manage dependencies such as Ansible which it automatically activates and uses when running any trellis command. But there's still a lot of times you may want to run ansible-playbook or pip manually in your shell. To make this experience seamless, trellis-cli offers shell integration which automatically activates the Virtualenv when you enter a Trellis project, and deactivates when you leave it.

venv integration

To enable this integration, add the following to your shell profile:

Bash (~/.bash_profile):

eval "$(trellis shell-init bash)"

Zsh (~/.zshrc):

eval "$(trellis shell-init zsh)"

Usage

Run trellis for the complete usage and help.

Supported commands so far:

Command Description
alias Generate WP CLI aliases for remote environments
check Checks if Trellis requirements are met
db Commands for database management
deploy Deploys a site to the specified environment
dotenv Template .env files to local system
down Stops the Vagrant machine by running vagrant halt
droplet Commands for DigitalOcean Droplets
exec Exec runs a command in the Trellis virtualenv
galaxy Commands for Ansible Galaxy
info Displays information about this Trellis project
init Initializes an existing Trellis project
new Creates a new Trellis project
provision Provisions the specified environment
rollback Rollsback the last deploy of the site on the specified environment
ssh Connects to host via SSH
up Starts and provisions the Vagrant environment by running vagrant up
valet Commands for Laravel Valet
vault Commands for Ansible Vault

Development

trellis-cli requires Go >= 1.18 (brew install go on macOS)

# Clone the repo
git clone https://github.com/roots/trellis-cli
cd trellis-cli

# Build the binary for your machine
go build

# Run tests (without integration tests)
go test -v -short ./...

# (Optional) Build the docker image for testing (requires `docker`)
make docker
# Alternatively, do not use cache when building the doccker image (requires `docker`)
make docker-no-cache

# Run all tests (requires `docker`)
make test

Releasing Docker Images

This section only intended for the maintainers

make docker-no-cache

# docker tag rootsdev/trellis-cli-dev:latest rootsdev/trellis-cli-dev:YYYY.MM.DD.N
# where N is a sequential integer, starting from 1.
docker tag rootsdev/trellis-cli-dev:latest rootsdev/trellis-cli-dev:2019.08.12.1

# docker push rootsdev/trellis-cli-dev:YYYY.MM.DD.N
docker push rootsdev/trellis-cli-dev:2019.08.12.1
docker push rootsdev/trellis-cli-dev:latest

Contributing

Contributions are welcome from everyone. We have contributing guidelines to help you get started.

Community

Keep track of development and community news.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].