about summary refs log tree commit diff
path: root/scripts/migrate_from_redis.pl
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--scripts/migrate_from_redis.pl41
1 files changed, 0 insertions, 41 deletions
diff --git a/scripts/migrate_from_redis.pl b/scripts/migrate_from_redis.pl
deleted file mode 100644
index 61490c1..0000000
--- a/scripts/migrate_from_redis.pl
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use warnings;
-
-use jitterbug::Schema;
-
-use YAML qw/LoadFile/;
-use JSON;
-
-my $conf = shift || die "config is missing";
-my $data = shift || die "data is missing";
-
-$conf = LoadFile($conf);
-$data = LoadFile($data);
-
-my $schema = jitterbug::Schema->connect(
-    @{ $conf->{plugins}->{DBIC}->{schema}->{connect_info} } );
-
-my $project = $schema->resultset('Project')->create(
-    {
-        name        => $data->{desc}->{name},
-        url         => $data->{desc}->{url},
-        description => $data->{desc}->{description},
-        owner       => JSON::encode_json( $data->{desc}->{owner} ),
-    }
-);
-
-foreach my $build ( @{ $data->{builds} } ) {
-    my $sha256    = delete $build->{commit};
-    my $timestamp = $build->{timestamp};
-    my $tests = delete $build->{version};
-    $build->{build}->{version} = $tests;
-    $schema->resultset('Commit')->create(
-        {
-            sha256    => $sha256,
-            projectid => $project->projectid,
-            timestamp => $timestamp,
-            content   => JSON::encode_json($build),
-        }
-    );
-}