Search code examples
ruby-on-railshudsonpassengerjenkinsyard

How I can run Yard server on production server?


How I can run Yard server on production server? Maybe use some task? Load from capistrano, using passenger and nginx, Jenkins(Hudson).


Solution

  • I'm use this shell script:

    #!/bin/sh
    #or you process here
    PROCESS='ruby */yard server'
    PID=`pidof $PROCESS`
    
    start() {
      yard server &
    }
    
    stop() {
      if [ "$PID" ];then
        kill -KILL $PID
        echo 'yard is stopped'
      fi
    }
    
    case "$1" in
    start)
      start
    ;;
    stop)
      stop
    ;;
    restart)
      stop
      start
    ;;
    *)
    echo Usage: $0 [start|stop|restart]
    ;;
    esac
    

    And in Hudson: yard doc && ./yard.sh restart.