[FIX] runbot: use upgrade path

Manage multiple upgrade_paths + small fix
This commit is contained in:
Xavier-Do 2023-09-15 09:27:28 +02:00 committed by xdo
parent f627ebaf0e
commit 8d619d11f8

View File

@ -725,9 +725,13 @@ class ConfigStep(models.Model):
migrate_cmd += ['-d', migrate_db_name]
migrate_cmd += ['--stop-after-init']
migrate_cmd += ['--max-cron-threads=0']
migration_scripts = ','.join([repo.name + repo.upgrade_paths.replace(' ', '') for repo in target_commit_ids.mapped('repo_id') if repo.upgrade_paths])
if migration_scripts:
migrate_cmd += ['--upgrades-paths', migration_scripts]
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(' ', ''))
if upgrade_paths:
migrate_cmd += ['--upgrade-path', ','.join(upgrade_paths)]
build._log('run', 'Start migration build %s' % build.dest)
timeout = self.cpu_limit