@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class RunIdMigrator extends Object
Nested Class Summary
Nested Classes Modifier and Type Class Description
RunIdMigrator.UnmigrationInstructionExpose unmigration instruction to the user.
Constructors Constructor Description
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description
created(File dir)Called when a job is first created.
delete(File dir, String id)Delete the record of a build.
findNumber(String id)Look up a historical run by ID.
main(String... args)Reverses the migration, in case you want to revert to the older format.
migrate(File dir, File jenkinsHome)Perform one-time migration if this has not been done already.
public void created(File dir)Called when a job is first created. Just saves an empty marker indicating that this job needs no migration.
dir- as in
migratePerform one-time migration if this has not been done already. Where previously there would be a
<number>99</number>plus a symlink
99 → 2014-01-02_03-04-05, after migration there will be just
<timestamp>…</timestamp>according to local time zone at time of migration. Newly created builds are untouched. Does not throw
IOExceptionsince we make a best effort to migrate but do not consider it fatal to job loading if we cannot.
dir- as in
jenkinsHome- root directory of Jenkins (for logging only)
- true if migration was performed
public int findNumber(@NonNull String id)Look up a historical run by ID.
deleteDelete the record of a build.