Skip to content

Instantly share code, notes, and snippets.

@lanwen
Last active March 16, 2017 13:53
Show Gist options
  • Save lanwen/751f7dd6d925e9923fb6a0cfdf373913 to your computer and use it in GitHub Desktop.
Save lanwen/751f7dd6d925e9923fb6a0cfdf373913 to your computer and use it in GitHub Desktop.
public class CreateTicketBuildStep extends Builder implements SimpleBuildStep {
public static class ConverterImpl extends XStream2.PassthruConverter<CreateTicketBuildStep> {
private static final Logger LOGGER = LoggerFactory.getLogger(ConverterImpl.class);
public ConverterImpl(XStream2 xstream) {
super(xstream);
}
@Override
protected void callback(CreateTicketBuildStep obj, UnmarshallingContext context) {
if (obj.getTicket().getPackages() != null) {
LOGGER.warn("[Plugin] Migration for create ticket build step needed...");
List<PackageSource> sources = obj.getTicket().getPackageSources() == null
? new ArrayList<>()
: obj.getTicket().getPackageSources();
obj.getTicket().getPackages().forEach(pkg -> sources.add(new OnePackageSource(pkg)));
obj.getTicket().setPackageSources(sources);
obj.getTicket().setPackages(null);
LOGGER.info("[Plugin] " +
"Migration for create ticket build step finished. Check old data monitor in global conf");
OldDataMonitor.report(context, "1.8.0.plugin");
}
}
}
}
<!--Для мигратора степа на новую версию-->
<dependency>
<groupId>org.jvnet.hudson</groupId>
<artifactId>xstream</artifactId>
<version>1.4.7-jenkins-1</version>
<scope>provided</scope>
</dependency>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment