Download the PHP package anystack-sh/porter without Composer
On this page you can find all versions of the php package anystack-sh/porter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download anystack-sh/porter
More information about anystack-sh/porter
Files in anystack-sh/porter
Package porter
Short Description Spin up your development background processes with ease.
License MIT
Homepage https://anystack.sh
Informations about the package porter
About Porter
Porter is a command-line interface (CLI) tool that makes it easy to run background services by adding a few lines to a configuration file.
These services are managed by Supervisord, a process control system that ensures that all processes are kept up and running.
With Porter, you don't have to manually start and manage background services in multiple terminal tabs.
Instead, you can simply use the porter
command to manage all of your services in a single place.
Installation
To install Porter, you can use composer
or download the build manually from this repository.
Requirements
To use Porter you must install supervisord
:
- macOS:
brew install supervisor
- Linux:
apt install supervisor
If you want to use the watch feature to restart services when files change you will also need to install:
- chokidar:
npm install --global chokidar
Add your first project
In your terminal navigate to your project and run porter init
to create a boilerplate porter.yml
:
Modify porter.yml
and add the services you want to run. In your terminal navigate to your project and run porter add
:
A new porter.yml
has been created. This file contains all the services you want to run in the background, for example:
The following properties are available per command:
Property | Description | Required |
---|---|---|
name | Shortname that describes your service. | Yes |
directory | Set the working directory, defaults to porter.yml directory. | No |
command | The command to run relative to the root of your project or custom defined directory. | Yes |
restart | ||
- minutes | After how many minutes the service should restart. | No |
- watch | Restart service if files or directories are modified. | No |
processes | Set the number of parallel processes for the service. Defaults to 1. | No |
environment | Set custom environment variables | No |
If you have made changes to your porter.yml
you can use the porter restart
command to apply your changes.
Monitoring services
To monitor your services you can use the porter status
command.
Tail service logs
Basic tail usage
You can tail one or more services (unified) using the porter tail
command.
This command is context-aware and will automatically ask which services you want to tail:
Tail all available services
To automatically tail all available services, pass the --all
option:
Tail one or more services
You can specify one or more services that you would like to tail by passing
the --services
option with a comma-separated list of service indexes or service names.
You can find the index and name of each available service by running porter tail
with no arguments:
The following examples reference the service names and indexes found above:
The above two commands are functionally equivalent.
The above two commands are functionally equivalent.
All available commands
Command | Description |
---|---|
porter add |
Add current directory as a new application. |
porter remove |
Remove current application services. |
porter start |
Start all services. |
porter restart |
Restart one or multiple services. |
porter stop |
Stop all services. |
porter tail |
Tail service logs. |
Brought to you by Anystack
Anystack is the all-in-one product platform that helps you make a living by writing code. Push your code to GitHub, and we will take care of everything else. Start your adventure today.
License
Porter is open-sourced software licensed under the MIT license.