- Reduce the live database set of the primary CPAN Testers servers
- Mostly-static data that does not need deep querying should be removed from the database
- Allow individuals to run CPAN Testers databases (schema, backend, api) for their own internal use
- Must have an easy way to run a single node that contains a database, backend, and API
- Must have an easy way to configure a tester to submit to the internal node
- Must have a web app to show the status of the local testing infrastructure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v5.28; | |
use warnings; | |
use experimental qw( signatures postderef ); | |
use version; | |
use Data::Printer; | |
use MetaCPAN::Client; | |
my $mcpan = MetaCPAN::Client->new; |
- Clone the deploy repository
- git clone https://github.com/cpan-testers/cpantesters-deploy
- cd cpantesters-deploy
- Start the development infrastructure in Docker
docker-compose start
- Web is deployed to http://127.0.0.1:3000
- API is deployed to http://127.0.0.1:4000
- Fetch some reports from the public API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vack() { | |
# Takes a keyword as an argument, acks current directory, opens a vim session | |
# with a tab for each file with a match found, and puts the keyword in the @/ | |
# register, so that you can `n` through matches. | |
my_search=$(ack -l "$1") | |
if [[ -z $my_search ]] | |
then | |
echo "No results found for $1" | |
else | |
args=(--cmd "let @/=\"$1\"" -p ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Local::Plugin::MyPlugin; | |
use Mojo::Base 'Mojolicious::Plugin'; | |
sub cached_thing { | |
state $cache = 'expensive'; | |
return $cache; | |
} | |
sub register { | |
my ( $self, $app, $conf ) = @_; | |
$app->helper( myplugin => sub { $self } ); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
use Time::HiRes qw( time ); | |
plugin Minion => { | |
SQLite => 'sqlite:' . app->home->child('minion.db'), | |
}; | |
app->minion->add_task( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Local::Controller::Kubernetes; | |
BEGIN { $INC{'Local/Controller/Kubernetes.pm'} = __FILE__ } | |
use Mojo::Base 'Mojolicious::Controller'; | |
sub log { shift->render( text => "Hello, World" ) } | |
package main; | |
use Mojolicious::Lite; | |
unshift @{ app->routes->namespaces }, 'Local::Controller'; | |
app->routes->get( '/' )->to( 'kubernetes#log' ); | |
app->start; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Local::Format; | |
BEGIN { $INC{'Local/Format.pm'} = __FILE__ }; | |
sub new { | |
my ( $class, %opt ) = @_; | |
$opt{delimiter} ||= ','; | |
return bless \%opt, $class; | |
} | |
package Local::Format::csv; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### -- Failure timeout after 60 seconds | |
$ curl -O http://api.cpantesters.org/v3/release | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 76 100 76 0 0 1 0 0:01:16 0:01:00 0:00:16 18 | |
$ head -c 60 release | |
{ "message" :"The API is temporarily unavailable. Please try% | |
### -- Bypass Fastly, success in 2.5 minutes | |
$ curl -O http://api-3.cpantesters.org/v3/release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<link rel="stylesheet" type="text/css" href="print.css" media="print" /> | |
</head> | |
<!DOCTYPE html> | |
<html dir="ltr" lang="en-gb"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> |