[IMP] runbot: add read_source on commit

This commit is contained in:
Xavier-Do 2019-07-12 16:31:17 +02:00
parent 21c3686543
commit c31c9642be
2 changed files with 10 additions and 2 deletions

View File

@ -28,9 +28,18 @@ class Commit():
def export(self):
return self.repo._git_export(self.sha)
def read_source(self, file, mode='r'):
file_path = self._source_path(file)
try:
with open(file_path, mode) as f:
return f.read()
except:
return False
def __str__(self):
return '%s:%s' % (self.repo.short_name, self.sha)
def fqdn():
return socket.getfqdn()

View File

@ -337,8 +337,7 @@ class ConfigStep(models.Model):
docker_source_folder = build._docker_source_folder(commit)
for manifest_file in commit.repo.manifest_files.split(','):
pattern_to_omit.add('*%s' % manifest_file)
for (addons_path, module, manifest_file_name) in build._get_available_modules(commit):
module = os.path.basename(module_path)
for (addons_path, module, _) in build._get_available_modules(commit):
if module not in modules_to_install:
# we want to omit docker_source_folder/[addons/path/]module/*
module_path_in_docker = os.path.join(docker_source_folder, addons_path, module)