Method: CiInACan::Cli::Files#service_file

Defined in:
lib/ci_in_a_can/cli/files.rb

#service_fileObject



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/ci_in_a_can/cli/files.rb', line 62

def service_file
  <<EOF
require 'ci_in_a_can'
require 'daemons'

this_directory = File.expand_path(File.dirname(__FILE__) + '/../')

eval("CiInACan.results_location = '\#{this_directory}' + '/results'")

::Daemons.run_proc('#{@id}_ci_server') do
  loop do
    options = {
          access_token:      ENV['GITHUB_AUTH_TOKEN'],
          working_location:  this_directory + "/repos",
          watching_location: this_directory + "/jobs",
          site_url:          ENV['SITE_URL']
        }
    CiInACan::Daemon.start options
    sleep
  end
end
EOF
end