mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 15:35:46 +07:00
[IMP] runbot: check dir exists upgrade path
This commit is contained in:
parent
269e59538e
commit
65a8f6da76
@ -1020,10 +1020,19 @@ class BuildResult(models.Model):
|
||||
for commit in (self.env.context.get('defined_commit_ids') or self.params_id.commit_ids):
|
||||
if not commit.repo_id.manifest_files:
|
||||
continue # skip repo without addons
|
||||
source_path = self._docker_source_folder(commit)
|
||||
repo_folder = self._docker_source_folder(commit)
|
||||
for addons_path in (commit.repo_id.addons_paths or '').split(','):
|
||||
if os.path.isdir(commit._source_path(addons_path)):
|
||||
yield os.sep.join([source_path, addons_path]).strip(os.sep)
|
||||
yield os.sep.join([repo_folder, addons_path]).strip(os.sep)
|
||||
|
||||
def _get_upgrade_path(self):
|
||||
for commit in (self.env.context.get('defined_commit_ids') or self.params_id.commit_ids):
|
||||
if not commit.repo_id.upgrade_paths:
|
||||
continue # skip repo without addons
|
||||
repo_folder = self._docker_source_folder(commit)
|
||||
for upgrade_path in commit.repo_id.upgrade_paths.split(','):
|
||||
if os.path.isdir(commit._source_path(upgrade_path)):
|
||||
yield os.sep.join([repo_folder, upgrade_path]).strip(os.sep)
|
||||
|
||||
def _get_server_info(self, commit=None):
|
||||
commit = commit or self._get_server_commit()
|
||||
|
@ -702,11 +702,7 @@ class ConfigStep(models.Model):
|
||||
migrate_cmd += ['-d', migrate_db_name]
|
||||
migrate_cmd += ['--stop-after-init']
|
||||
migrate_cmd += ['--max-cron-threads=0']
|
||||
upgrade_paths = []
|
||||
for repo in target_commit_ids.mapped('repo_id'):
|
||||
if repo.upgrade_paths:
|
||||
for upgrade_path in repo.upgrade_paths.split(','):
|
||||
upgrade_paths.append(repo.name + upgrade_path.replace(' ', ''))
|
||||
upgrade_paths = list(build._get_upgrade_path())
|
||||
if upgrade_paths:
|
||||
migrate_cmd += ['--upgrade-path', ','.join(upgrade_paths)]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user