Skip to content

Commit

Permalink
buildmaster/builders: Some basic cleanups and repairs
Browse files Browse the repository at this point in the history
  • Loading branch information
kallisti5 committed Aug 30, 2024
1 parent 651fe61 commit d77727f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions HaikuPorter/BuildMaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ def __init__(self, portsTreePath, packageRepository, options):

self.activeBuilders.append(builder)

print('Active builder count: ' + str(len(self.activeBuilders)))
for i in self.activeBuilders:
print(' builder: ' + str(i.name) + ' (' + str(i.type) + ')')

if len(self.activeBuilders) == 0:
sysExit('no builders available')

Expand Down
11 changes: 11 additions & 0 deletions HaikuPorter/Builders/LocalBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

class LocalBuilder(object):
def __init__(self, name, packageRepository, outputBaseDir, options):
self.type = "LocalBuilder"
self.options = options
self.name = name
self.buildCount = 0
Expand Down Expand Up @@ -52,6 +53,16 @@ def setBuild(self, scheduledBuild, buildNumber):
}
filter.setBuild(self.currentBuild)

@property
def status(self):
return {
'name': self.name,
'state': self.state,
'currentBuild': {
'build': self.currentBuild['status'],
'number': self.currentBuild['number']
} if self.currentBuild else None
}

def unsetBuild(self):
self.buildLogger.removeHandler(self.currentBuild['logHandler'])
Expand Down
1 change: 1 addition & 0 deletions HaikuPorter/Builders/MockBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

class MockBuilder(object):
def __init__(self, name, buildFailInterval, builderFailInterval, lostAfter):
self.type = "MockBuilder"
self.name = name
self.buildCount = 0
self.failedBuilds = 0
Expand Down
1 change: 1 addition & 0 deletions HaikuPorter/Builders/RemoteBuilderSSH.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class RemoteBuilderSSH(object):
def __init__(self, configFilePath, packageRepository, outputBaseDir,
portsTreeOriginURL, portsTreeHead):
self._loadConfig(configFilePath)
self.type = "RemoteBuilderSSH"
self.availablePackages = []
self.visiblePackages = []
self.portsTreeOriginURL = portsTreeOriginURL
Expand Down

0 comments on commit d77727f

Please sign in to comment.