def start_build(self, plan_id): plan = self.db.get_plan(plan_id) # example: # (1, 1, 1, 'retrieve', 0, None, None, None, None, None) if plan[3] == 'retrieve': # do retrieve # TODO: setting the plan in the list as 'busy' or something print('Starting a retrieve build...') #self.db.set_build_status(id, 'building') self.current_builds.append(Build('retrieve', self.db, plan_id)) elif plan[3] == 'deploy': # do deploy print('Starting a deployment build...') #self.db.set_build_status(id, 'building') self.current_builds.append(Build('deploy', self.db, plan_id))
def __init__(self, db): ''' General description: This function initializes the database variables and \ index to refer in functions. ''' DBUtil.__init__(self, db) self.collection = db.State self.deploymentunitapprovalstatusdb = DeploymentUnitApprovalStatus.DeploymentUnitApprovalStatus( ) self.DeploymentFieldsdb = DeploymentFields.DeploymentFields(db) self.buildDb = Build.Build() # indexes self.collection.create_index([('name', ASCENDING), ('parent_entity_id', ASCENDING)], unique=True)
def __init__(self, db): ''' General description: This function initializes the database variables and \ index to refer in functions. ''' DBUtil.__init__(self, db) self.collection = db.Versions self.deploymentFieldsDB = DeploymentFields.DeploymentFields(db) self.buildDB = Build.Build() self.documentsDB = Documents.Documents(db) self.mediaFilesDB = MediaFiles.MediaFiles(db) # indexes self.collection.create_index([('tool_id', ASCENDING), ('version_name', ASCENDING), ('version_number', ASCENDING)], unique=True)
def __init__(self): ''' General description: This function initializes the database variables and \ index to refer in functions. ''' db = mongodb DBUtil.__init__(self, db) self.collection = db.DeploymentUnit self.deploymentUnitApprovalStatusDB = DeploymentUnitApprovalStatus.DeploymentUnitApprovalStatus( ) self.tagDB = Tags.Tags() self.buildDB = Build.Build() self.deploymentFieldsDB = DeploymentFields.DeploymentFields(db) self.deploymentUnitTypeDB = DeploymentUnitType.DeploymentUnitType() self.statedb = State.State(db) # self.deploymentUnitSetDB = DeploymentUnitSet.DeploymentUnitSet() # indexes self.collection.create_index([('name', ASCENDING)], unique=True)