!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
# ABSTRACT: Script to generate buildinfo.json for Plack::App::ServiceStatus
# PODNAME: plack_app_service_status_generate_buildinfo.pl
our $VERS
se Pod::Usage;
my $man = 0;
my $help = 0;
my $buildinfo_file = "./buildinfo.json";
my $project_dir = '';
GetOptions(
'help|?' => \$help,
man => \$man,
"
Cannot write to $buildinfo_file: $!";
chdir($project_dir);
my $data = '{'; # just concat the JSON :-)
my $now = strftime( '%Y-%m-%dT%H:%M:%SZ', gmtime( time() ) );
$data .= qq{"date":"$now"};
m
ersion checks show_hostname buildinfo _buildinfo_data));
use Try::Tiny;
use Plack::Response;
use JSON::MaybeXS;
use Sys::Hostname qw(hostname);
use Module::Runtime qw(use_module);
use Log::Any qw($lo
ildinfo;
if ( -f $buildinfo_file ) {
$buildinfo =
eval { decode_json( path( $buildinfo_file )->slurp_utf8 ) };
if ($@) {
$buildinfo = { st
self->show_hostname ? hostname() : '';
my $app = sub {
my $env = shift;
my $json = {
app => $self->app,
started_at_iso8601 => strftime( '%Y