Code Monkey home page Code Monkey logo

raketasktrigger's Introduction

Rake Task Trigger

Description

Node worker to spawn a rake task when a message is pulled from a queue.

This worker monitors for a cloudq message on the queue specified. When a message is found it runs the specified rake task.

Polls cloudq every 10 minutes by default for a trigger message.

Environment Variables

CLOUDQ: uri for cloudq server to monitor with queue name.
  ** example: 'http://localhost:3005/queue_to_monitor'
TASK_PROJECT_PATH:  Local file path to art vandelay project/repository.
  ** Required, no default
TASK_NAME:  Name of rake task to run.
  ** Required, no default
  ** example: rake_environment:best_rake_task
HOME_DIR:  Path to home directory of user where rvm is installed. 
  ** defaults to current users home directory.  i.e. /home/your_username
POLL_INTERVAL:  Interval in seconds that cloudq is checked
  ** defaults to 600 seconds or 10 minutes
DINGBOT_URL: Url to dingbot server service can check in at
  ** defaults to null, and will not try to checkin
RUNTIME_ENVS: Environment variables that will be used when running the rake task

Configure to start/monitor with upstart on Ubuntu server

** edit upstart_job/rakeTaskTrigger.conf to verify paths and Environment Variable values.

sudo cp upstart_job/* /etc/init/

To start and stop:

start <fileNameOfUpstartJob>    i.e. start rakeTaskTrigger    
stop  <fileNameOfUpstartJob>    i.e. stop  rakeTaskTrigger

Example Config

cp upstart_job/rakeTaskTrigger.conf upstart_job/rakeTaskTrigger_production.conf
vi upstart_job/rakeTaskTrigger_production.conf
    ** change config values for dev environment
sudo cp upstart_job/rakeTaskTrigger_production.conf /etc/init/
To Start: start rakeTaskTrigger_production
To Stop: stop rakeTaskTrigger_production

raketasktrigger's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.