* More global substitution.

This commit is contained in:
Eelco Dolstra 2008-11-25 11:01:42 +00:00
parent 22feae550e
commit 410b80063c
24 changed files with 106 additions and 118 deletions

View file

@ -2,8 +2,8 @@
# expected. you have been warned
use inc::Module::Install;
name 'HydraFrontend';
all_from 'lib/HydraFrontend.pm';
name 'Hydra';
all_from 'lib/Hydra.pm';
requires 'Catalyst::Runtime' => '5.7015';
requires 'Catalyst::Plugin::ConfigLoader';

View file

@ -1 +1 @@
name HydraFrontend
name Hydra

View file

@ -1,4 +1,4 @@
package HydraFrontend;
package Hydra;
use strict;
use warnings;
@ -14,7 +14,7 @@ use Catalyst qw/-Debug
our $VERSION = '0.01';
__PACKAGE__->config(
name => 'HydraFrontend',
name => 'Hydra',
default_view => "TT"
);

View file

@ -1,9 +1,9 @@
package HydraFrontend::Controller::Root;
package Hydra::Controller::Root;
use strict;
use warnings;
use parent 'Catalyst::Controller';
use HydraFrontend::Helper::Nix;
use Hydra::Helper::Nix;
#
# Sets the actions in this controller to be registered with no prefix
@ -394,9 +394,9 @@ sub closure :Local {
return error($c, "Product is not a Nix build.") if $product->type ne "nix-build";
return error($c, "Path " . $product->path . " is no longer available.") unless HydraFrontend::Helper::Nix::isValidPath($product->path);
return error($c, "Path " . $product->path . " is no longer available.") unless Hydra::Helper::Nix::isValidPath($product->path);
$c->stash->{current_view} = 'HydraFrontend::View::NixClosure';
$c->stash->{current_view} = 'Hydra::View::NixClosure';
$c->stash->{storePath} = $product->path;
$c->stash->{name} = $build->nixname;
}

View file

@ -1,4 +1,4 @@
package HydraFrontend::Helper::Nix;
package Hydra::Helper::Nix;
use strict;

View file

@ -1,10 +1,10 @@
package HydraFrontend::Model::DB;
package Hydra::Model::DB;
use strict;
use base 'Catalyst::Model::DBIC::Schema';
__PACKAGE__->config(
schema_class => 'HydraFrontend::Schema',
schema_class => 'Hydra::Schema',
connect_info => [
'dbi:SQLite:../hydra.sqlite',
@ -13,14 +13,14 @@ __PACKAGE__->config(
=head1 NAME
HydraFrontend::Model::DB - Catalyst DBIC Schema Model
Hydra::Model::DB - Catalyst DBIC Schema Model
=head1 SYNOPSIS
See L<HydraFrontend>
See L<Hydra>
=head1 DESCRIPTION
L<Catalyst::Model::DBIC::Schema> Model using schema L<HydraFrontend::Schema>
L<Catalyst::Model::DBIC::Schema> Model using schema L<Hydra::Schema>
=head1 AUTHOR

View file

@ -1,4 +1,4 @@
package HydraFrontend::Schema;
package Hydra::Schema;
use strict;
use warnings;
@ -8,8 +8,8 @@ use base 'DBIx::Class::Schema';
__PACKAGE__->load_classes;
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rS2THZrlrDHnIAWmvduE1g
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 11:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:8AQc7Q1I5DrtSjFp722iMA
# You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -1,4 +1,4 @@
package HydraFrontend::Schema::Buildinputs;
package Hydra::Schema::Buildinputs;
use strict;
use warnings;
@ -32,16 +32,12 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0, size => undef },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" });
__PACKAGE__->belongs_to(
"dependency",
"HydraFrontend::Schema::Builds",
{ id => "dependency" },
);
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
__PACKAGE__->belongs_to("dependency", "Hydra::Schema::Builds", { id => "dependency" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9u9ep3Cq/SginPyhrzXlTA
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 11:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:NSUTUwG2qbvbFkZxezeSEA
# You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -1,4 +1,4 @@
package HydraFrontend::Schema::Buildproducts;
package Hydra::Schema::Buildproducts;
use strict;
use warnings;
@ -30,11 +30,11 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0, size => undef },
);
__PACKAGE__->set_primary_key("build", "productnr");
__PACKAGE__->belongs_to("build", "HydraFrontend::Schema::Builds", { id => "build" });
__PACKAGE__->belongs_to("build", "Hydra::Schema::Builds", { id => "build" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:d85fCxlq/WDfQa20zXYuzw
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 11:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9b3ZNy73Cjat0gr5nQHIpA
# You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -1,4 +1,4 @@
package HydraFrontend::Schema::Buildresultinfo;
package Hydra::Schema::Buildresultinfo;
use strict;
use warnings;
@ -24,11 +24,11 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0, size => undef },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c2KXbqA8Xan4Lgf7AlK2EA
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 11:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:uTiPHxrs6S19Laa/qeb7CA
# You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -1,4 +1,4 @@
package HydraFrontend::Schema::Builds;
package Hydra::Schema::Builds;
use strict;
use warnings;
@ -32,64 +32,60 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0, size => undef },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to(
"project",
"HydraFrontend::Schema::Projects",
{ name => "project" },
);
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" });
__PACKAGE__->belongs_to(
"jobset",
"HydraFrontend::Schema::Jobsets",
"Hydra::Schema::Jobsets",
{ name => "jobset", project => "project" },
);
__PACKAGE__->has_many(
"buildschedulinginfoes",
"HydraFrontend::Schema::Buildschedulinginfo",
"Hydra::Schema::Buildschedulinginfo",
{ "foreign.id" => "self.id" },
);
__PACKAGE__->has_many(
"buildresultinfoes",
"HydraFrontend::Schema::Buildresultinfo",
"Hydra::Schema::Buildresultinfo",
{ "foreign.id" => "self.id" },
);
__PACKAGE__->has_many(
"buildsteps",
"HydraFrontend::Schema::Buildsteps",
"Hydra::Schema::Buildsteps",
{ "foreign.id" => "self.id" },
);
__PACKAGE__->has_many(
"buildinputs_builds",
"HydraFrontend::Schema::Buildinputs",
"Hydra::Schema::Buildinputs",
{ "foreign.build" => "self.id" },
);
__PACKAGE__->has_many(
"buildinputs_dependencies",
"HydraFrontend::Schema::Buildinputs",
"Hydra::Schema::Buildinputs",
{ "foreign.dependency" => "self.id" },
);
__PACKAGE__->has_many(
"buildproducts",
"HydraFrontend::Schema::Buildproducts",
"Hydra::Schema::Buildproducts",
{ "foreign.build" => "self.id" },
);
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/Iabv2HeyAsubLe+yPc/6Q
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 11:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ky0EF25kaZIaY+ofkP0ohw
__PACKAGE__->has_many(dependents => 'HydraFrontend::Schema::Buildinputs', 'dependency');
__PACKAGE__->has_many(dependents => 'Hydra::Schema::Buildinputs', 'dependency');
__PACKAGE__->has_many(inputs => 'HydraFrontend::Schema::Buildinputs', 'build');
__PACKAGE__->has_many(inputs => 'Hydra::Schema::Buildinputs', 'build');
__PACKAGE__->belongs_to(
"schedulingInfo",
"HydraFrontend::Schema::Buildschedulinginfo",
"Hydra::Schema::Buildschedulinginfo",
{ id => "id" },
);
__PACKAGE__->belongs_to(
"resultInfo",
"HydraFrontend::Schema::Buildresultinfo",
"Hydra::Schema::Buildresultinfo",
{ id => "id" },
);

View file

@ -1,4 +1,4 @@
package HydraFrontend::Schema::Buildschedulinginfo;
package Hydra::Schema::Buildschedulinginfo;
use strict;
use warnings;
@ -20,11 +20,11 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 0, size => undef },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vqJ7HEML5YNn5VIXEhZbnw
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 11:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:kt5gBt14ay7/DiIaQpKopA
# You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -1,4 +1,4 @@
package HydraFrontend::Schema::Buildsteps;
package Hydra::Schema::Buildsteps;
use strict;
use warnings;
@ -32,11 +32,11 @@ __PACKAGE__->add_columns(
{ data_type => "integer", is_nullable => 0, size => undef },
);
__PACKAGE__->set_primary_key("id", "stepnr");
__PACKAGE__->belongs_to("id", "HydraFrontend::Schema::Builds", { id => "id" });
__PACKAGE__->belongs_to("id", "Hydra::Schema::Builds", { id => "id" });
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BuZp6PHq9l/9xyA/x7TOVQ
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 11:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ljGW5oOaJQ/uUKQx80W5SA
# You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -1,4 +1,4 @@
package HydraFrontend::Schema::Jobsetinputalts;
package Hydra::Schema::Jobsetinputalts;
use strict;
use warnings;
@ -26,13 +26,13 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("project", "jobset", "input", "altnr");
__PACKAGE__->belongs_to(
"jobsetinput",
"HydraFrontend::Schema::Jobsetinputs",
"Hydra::Schema::Jobsetinputs",
{ jobset => "jobset", name => "input", project => "project" },
);
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:x7OCv8YzB2L4H+RxEfwjbg
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 11:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mG0ka8XxC3ZEs/KgGKe5Hg
# You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -1,4 +1,4 @@
package HydraFrontend::Schema::Jobsetinputs;
package Hydra::Schema::Jobsetinputs;
use strict;
use warnings;
@ -20,7 +20,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("project", "jobset", "name");
__PACKAGE__->has_many(
"jobsets",
"HydraFrontend::Schema::Jobsets",
"Hydra::Schema::Jobsets",
{
"foreign.name" => "self.job",
"foreign.nixexprinput" => "self.name",
@ -29,12 +29,12 @@ __PACKAGE__->has_many(
);
__PACKAGE__->belongs_to(
"jobset",
"HydraFrontend::Schema::Jobsets",
"Hydra::Schema::Jobsets",
{ name => "jobset", project => "project" },
);
__PACKAGE__->has_many(
"jobsetinputalts",
"HydraFrontend::Schema::Jobsetinputalts",
"Hydra::Schema::Jobsetinputalts",
{
"foreign.input" => "self.name",
"foreign.jobset" => "self.jobset",
@ -43,8 +43,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SKU48+1LqxIcuVY5gaDHCg
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 11:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:trcxVA3lLfgTC0TCHL3mVw
# You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -1,4 +1,4 @@
package HydraFrontend::Schema::Jobsets;
package Hydra::Schema::Jobsets;
use strict;
use warnings;
@ -22,25 +22,21 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("project", "name");
__PACKAGE__->has_many(
"builds",
"HydraFrontend::Schema::Builds",
"Hydra::Schema::Builds",
{
"foreign.jobset" => "self.name",
"foreign.project" => "self.project",
},
);
__PACKAGE__->belongs_to(
"project",
"HydraFrontend::Schema::Projects",
{ name => "project" },
);
__PACKAGE__->belongs_to("project", "Hydra::Schema::Projects", { name => "project" });
__PACKAGE__->belongs_to(
"jobsetinput",
"HydraFrontend::Schema::Jobsetinputs",
"Hydra::Schema::Jobsetinputs",
{ job => "name", name => "nixexprinput", project => "project" },
);
__PACKAGE__->has_many(
"jobsetinputs",
"HydraFrontend::Schema::Jobsetinputs",
"Hydra::Schema::Jobsetinputs",
{
"foreign.jobset" => "self.name",
"foreign.project" => "self.project",
@ -48,8 +44,8 @@ __PACKAGE__->has_many(
);
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:F3WF5YS/Yas12dK2Gyekpg
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 11:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:MYl8lWfWLCIAGSulR3m5zw
# You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -1,4 +1,4 @@
package HydraFrontend::Schema::Projects;
package Hydra::Schema::Projects;
use strict;
use warnings;
@ -20,18 +20,18 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("name");
__PACKAGE__->has_many(
"builds",
"HydraFrontend::Schema::Builds",
"Hydra::Schema::Builds",
{ "foreign.project" => "self.name" },
);
__PACKAGE__->has_many(
"jobsets",
"HydraFrontend::Schema::Jobsets",
"Hydra::Schema::Jobsets",
{ "foreign.project" => "self.name" },
);
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-24 17:46:46
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:M+HA5YEL1oKKTQlLvhb6dw
# Created by DBIx::Class::Schema::Loader v0.04005 @ 2008-11-25 11:59:19
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tLlYQAkX5CeUR2GJir8ifg
# You can replace this text with custom content, and it will be preserved on regeneration

View file

@ -1,4 +1,4 @@
package HydraFrontend::View::NixClosure;
package Hydra::View::NixClosure;
use strict;
use base qw/Catalyst::View/;

View file

@ -1,4 +1,4 @@
package HydraFrontend::View::TT;
package Hydra::View::TT;
use strict;
use base 'Catalyst::View::TT';

View file

@ -6,15 +6,15 @@ use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use HydraFrontend;
use Hydra;
HydraFrontend->run;
Hydra->run;
1;
=head1 NAME
hydrafrontend_cgi.pl - Catalyst CGI
hydra_cgi.pl - Catalyst CGI
=head1 SYNOPSIS

View file

@ -20,17 +20,17 @@ pod2usage(1) if ( $help || !$ARGV[0] );
my $helper = Catalyst::Helper->new( { '.newfiles' => !$force, mech => $mech } );
pod2usage(1) unless $helper->mk_component( 'HydraFrontend', @ARGV );
pod2usage(1) unless $helper->mk_component( 'Hydra', @ARGV );
1;
=head1 NAME
hydrafrontend_create.pl - Create a new Catalyst Component
hydra_create.pl - Create a new Catalyst Component
=head1 SYNOPSIS
hydrafrontend_create.pl [options] model|view|controller name [helper] [options]
hydra_create.pl [options] model|view|controller name [helper] [options]
Options:
-force don't create a .new file where a file to be created exists
@ -38,16 +38,16 @@ hydrafrontend_create.pl [options] model|view|controller name [helper] [options]
-help display this help and exits
Examples:
hydrafrontend_create.pl controller My::Controller
hydrafrontend_create.pl controller My::Controller BindLex
hydrafrontend_create.pl -mechanize controller My::Controller
hydrafrontend_create.pl view My::View
hydrafrontend_create.pl view MyView TT
hydrafrontend_create.pl view TT TT
hydrafrontend_create.pl model My::Model
hydrafrontend_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
hydra_create.pl controller My::Controller
hydra_create.pl controller My::Controller BindLex
hydra_create.pl -mechanize controller My::Controller
hydra_create.pl view My::View
hydra_create.pl view MyView TT
hydra_create.pl view TT TT
hydra_create.pl model My::Model
hydra_create.pl model SomeDB DBIC::Schema MyApp::Schema create=dynamic\
dbi:SQLite:/tmp/my.db
hydrafrontend_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
hydra_create.pl model AnotherDB DBIC::Schema MyApp::Schema create=static\
dbi:Pg:dbname=foo root 4321
See also:

View file

@ -8,7 +8,7 @@ use Getopt::Long;
use Pod::Usage;
use FindBin;
use lib "$FindBin::Bin/../lib";
use HydraFrontend;
use Hydra;
my $help = 0;
my ( $listen, $nproc, $pidfile, $manager, $detach, $keep_stderr );
@ -25,7 +25,7 @@ GetOptions(
pod2usage(1) if $help;
HydraFrontend->run(
Hydra->run(
$listen,
{ nproc => $nproc,
pidfile => $pidfile,
@ -39,11 +39,11 @@ HydraFrontend->run(
=head1 NAME
hydrafrontend_fastcgi.pl - Catalyst FastCGI
hydra_fastcgi.pl - Catalyst FastCGI
=head1 SYNOPSIS
hydrafrontend_fastcgi.pl [options]
hydra_fastcgi.pl [options]
Options:
-? -help display this help and exits

View file

@ -52,9 +52,9 @@ if ( $debug ) {
# This is require instead of use so that the above environment
# variables can be set at runtime.
require HydraFrontend;
require Hydra;
HydraFrontend->run( $port, $host, {
Hydra->run( $port, $host, {
argv => \@argv,
'fork' => $fork,
keepalive => $keepalive,
@ -69,11 +69,11 @@ HydraFrontend->run( $port, $host, {
=head1 NAME
hydrafrontend_server.pl - Catalyst Testserver
hydra_server.pl - Catalyst Testserver
=head1 SYNOPSIS
hydrafrontend_server.pl [options]
hydra_server.pl [options]
Options:
-d -debug force debug mode

View file

@ -6,7 +6,7 @@ use Getopt::Long;
use Pod::Usage;
use FindBin;
use lib "$FindBin::Bin/../lib";
use Catalyst::Test 'HydraFrontend';
use Catalyst::Test 'Hydra';
my $help = 0;
@ -20,18 +20,18 @@ print request($ARGV[0])->content . "\n";
=head1 NAME
hydrafrontend_test.pl - Catalyst Test
hydra_test.pl - Catalyst Test
=head1 SYNOPSIS
hydrafrontend_test.pl [options] uri
hydra_test.pl [options] uri
Options:
-help display this help and exits
Examples:
hydrafrontend_test.pl http://localhost/some_action
hydrafrontend_test.pl /some_action
hydra_test.pl http://localhost/some_action
hydra_test.pl /some_action
See also:
perldoc Catalyst::Manual