-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3bace9
commit 3d4aa5e
Showing
10 changed files
with
95 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,41 @@ | ||
# foreman | ||
# Foreman | ||
It is a [foreman](https://github.com/ddollar/foreman) implementation in GO. | ||
|
||
## Description | ||
Foreman is a manager for [Procfile-based](https://en.wikipedia.org/wiki/Procfs) applications. Its aim is to abstract away the details of the Procfile format, and allow you to run your services directly. | ||
|
||
## Features | ||
- Run procfile-backed apps. | ||
- Able to run with dependency resolution. | ||
|
||
## Procfile | ||
Procfile is simply `key: value` format like: | ||
```yaml | ||
app1: | ||
cmd: ping -c 1 google.com | ||
run_once: false | ||
checks: | ||
cmd: ps aux | grep google | ||
deps: | ||
- redis | ||
app2: | ||
cmd: ping -c 5 yahoo.com | ||
checks: | ||
cmd: ps aux | grep yahoo | ||
|
||
redis: | ||
cmd: redis-server --port 6010 | ||
checks: | ||
cmd: redis-cli -p 6010 ping | ||
tcp_ports: [6010] | ||
``` | ||
**Here** we defined three services `app1`, `app2` and `redis` with check commands and dependency matrix | ||
|
||
## How to use | ||
**First:** modify the procfile with processes or services you want to run. | ||
|
||
**second**: Simply run with command: | ||
```sh | ||
$ ./foreman | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package foreman |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
package foreman | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package depgraph |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package procparser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
service_ping: | ||
cmd: ping -c 2 google.com | grep google | ||
checks: | ||
cmd: ls | ||
deps: | ||
- service_redis | ||
|
||
service_sleep: | ||
cmd: sleep 5 | ||
checks: | ||
cmd: ls | ||
deps: | ||
- service_ping | ||
|
||
service_redis: | ||
cmd: redis-server --port 6010 | ||
run_once: true | ||
checks: | ||
cmd: redis-cli -p 6010 ping |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
this is invalid Procfile syntax, Procfile must be yaml file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
sleeper: | ||
run_once: true | ||
cmd: sleep infinity | ||
checks: | ||
cmd: ls | ||
tcp_ports: [4759, 1865] | ||
udp_ports: [4500, 3957] | ||
deps: | ||
- hello | ||
|
||
hello: | ||
run_once: true | ||
cmd: echo "hello" | ||
deps: | ||
- sleeper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
sleeper: | ||
run_once: true | ||
cmd: sleep infinity | ||
checks: | ||
cmd: ls | ||
tcp_ports: [4759, 1865] | ||
udp_ports: [4500, 3957] | ||
deps: | ||
- hello | ||
|
||
hello: | ||
run_once: true | ||
cmd: echo "hello" |