Class: NdrDevSupport::Daemon::CIServer
- Inherits:
-
Object
- Object
- NdrDevSupport::Daemon::CIServer
- Includes:
- Stoppable
- Defined in:
- lib/ndr_dev_support/daemon/ci_server.rb
Overview
Wrapper around Rake based CI testing loop
Constant Summary collapse
- GIT_SVN_REMOTE_BRANCH_NAME =
'git-svn'.freeze
- MASTER_BRANCH_NAME =
'master'.freeze
- ORIGIN_MASTER_BRANCH_NAME =
'origin/master'.freeze
Constants included from Stoppable
Stoppable::BIG_SLEEP, Stoppable::LITTLE_SLEEP, Stoppable::MAX_MEMORY, Stoppable::MAX_UPTIME, Stoppable::RESTART_FILENAME
Instance Attribute Summary collapse
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:) ⇒ CIServer
constructor
A new instance of CIServer.
Methods included from Stoppable
#log, #logger, #run, #should_stop?, #stop
Constructor Details
#initialize(name:) ⇒ CIServer
Returns a new instance of CIServer.
26 27 28 29 30 31 32 33 34 |
# File 'lib/ndr_dev_support/daemon/ci_server.rb', line 26 def initialize(name:) super # Worker name can be used for clear logging: @name = name raise ArgumentError, 'No WORKER_NAME specified!' if name.blank? @repo = Rugged::Repository.new('.') end |
Instance Attribute Details
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
18 19 20 |
# File 'lib/ndr_dev_support/daemon/ci_server.rb', line 18 def repo @repo end |
Class Method Details
.friendly_revision_name(commit) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/ndr_dev_support/daemon/ci_server.rb', line 36 def self.friendly_revision_name(commit) if (matchdata = commit..match(/\bgit-svn-id: [^@]+@(\d+)\s/)) matchdata[1] else commit.oid[0, 7] end end |
.from_args(env) ⇒ Object
20 21 22 23 24 |
# File 'lib/ndr_dev_support/daemon/ci_server.rb', line 20 def self.from_args(env) name = env['WORKER_NAME'].to_s new(name: name) end |