OYE

A continuous integration tool

Description

Oye (spanish word for “hear”) is a continuous integration script that performs these tasks:

  1. initialize specified apps that are not running.
  2. checks for changes in origin git repos.
  3. updates cloned repos if origin repo changes.
  4. restarts the app with the new code.

Installation

Get the gem with:

gem install oye

Usage

1. Create a configuration file ~/.oye/oye.yml containing origin and cloned repositories:

/git/origin1.git:
  - /var/www/html/clone1
  - /var/www/html/clone2
/git/origin2.git:
  - /var/www/html/clone3

2. Run oye

oye

Troubleshooting

Verify that oye is running:

ps -o pid,stat,command $(pidof ruby)
  PID STAT COMMAND
16424 S    ruby /home/sergioro/.rvm/gems/ruby-2.7.0/bin/oye
16463 S    unicorn_rails master -E production -D -c /var/www/html/clone1/config/unicorn.rb
16464 Sl   unicorn_rails worker[0] -E production -D -c /var/www/html/clone1/config/unicorn.rb
16465 S    unicorn_rails master -E production -D -c /var/www/html/clone2/config/unicorn.rb
16466 Sl   unicorn_rails worker[0] -E production -D -c /var/www/html/clone2/config/unicorn.rb
16467 S    unicorn_rails master -E production -D -c /var/www/html/clone2/config/unicorn.rb
16468 Sl   unicorn_rails worker[0] -E production -D -c /var/www/html/clone2/config/unicorn.rb

Print the default options:

oye -h
-c, --config            print config, log and pid files
-e, --environment ENV   environment for the app server [development|production|test] (default production)
-h, --help              print this message
-i, --info [PATTERN]    print info of repos matching PATTERN (default .*)
-l, --list              print monitored repos
-p, --port PORT         port for app server
-r, --restart           restart oye
-s, --stop              stop oye
-t, --time SECS         time interval for repo monitoring (default 5)
-v, --version           print oye versio

Monitor the log file:

tail -f ~/.oye/oye.log
[2020-05-22 05:28:45] /var/www/html/clone1 [INFO] "Pulled from origin"
[2020-05-22 05:31:53] /var/www/html/clone2 [INFO] "Pulled from origin"
[2020-05-22 05:50:44] /var/www/html/clone1 [INFO] "Started app server"
[2020-05-22 05:52:24] /var/www/html/clone3 [INFO] "Pulled from origin"
[2020-05-22 05:52:34] /var/www/html/clone2 [INFO] "Started app server"
[2020-05-22 09:27:05] /var/www/html/clone3 [INFO] "Started app server"

Release Notes

  • v0.1.11:
    • Suported version control systems: Git.
    • Suported frameworkd: Ruby on Rails, Jekyll.
    • Suported app servers: Unicorn.