Skip to content

Instantly share code, notes, and snippets.

@skizzerz
Last active May 23, 2020 03:48
Show Gist options
  • Save skizzerz/85a0a2d4a6176ffa67004cd22c507799 to your computer and use it in GitHub Desktop.
Save skizzerz/85a0a2d4a6176ffa67004cd22c507799 to your computer and use it in GitHub Desktop.
package Cpanel::API::VCDeployStatus;
use strict;
use warnings;
our $VERSION = '1.0.0';
# Because VersionControlDeployment::retrieve sucks and doesn't let us filter on a given id
use Cpanel::VersionControl::Deployment::DB ();
our %API = (
_needs_feature => 'version_control'
);
sub retrieve {
my ($args, $result) = @_;
my $deploy_id = $args->get_length_required('deploy_id');
my $db = Cpanel::VersionControl::Deployment::DB->new();
my $deploy = $db->retrieve($deploy_id);
if (!defined($deploy)) {
$result->error('“[_1]” is not a valid “[_2]”.', $deploy_id, 'deploy_id');
return;
}
$result->data($deploy);
return 1;
}
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment