Add to DB when jobs happen.

master
Blog Manager Robot 3 years ago
parent d0484b25f3
commit 915db5f8dd
  1. 9
      Web/lib/MJB/Web/Controller/Blog.pm
  2. 6
      Web/lib/MJB/Web/Controller/Dashboard.pm

@ -65,12 +65,8 @@ sub do_create ($c) {
notes => { '_mjb_bid_' . $blog->id => 1 },
queue => 'certbot',
});
$blog->create_related( 'builds', { job_id => $ssl_job_id } );
$c->minion->enqueue( 'deploy_blog', [ $blog->id ], {
notes => { '_mjb_bid_' . $blog->id => 1 },
parents => [ $ssl_job_id ],
});
$c->redirect_to( $c->url_for( 'show_blog_settings', { id => $blog->id } ) );
}
@ -104,9 +100,10 @@ sub do_settings ( $c ) {
$jekyll->write_config;
$c->minion->enqueue( 'deploy_blog', [ $blog->id ], {
my $build_job_id = $c->minion->enqueue( 'deploy_blog', [ $blog->id ], {
notes => { '_mjb_bid_' . $blog->id => 1 },
});
$blog->create_related( 'builds', { job_id => $build_job_id } );
$c->flash( confirmation => "Welcome to the dashboard for your new blog!" );
$c->redirect_to( $c->url_for( 'show_dashboard_blog', { id => $blog->id } ) );

@ -79,7 +79,8 @@ sub do_blog_post ( $c ) {
$jekyll->write_post( $post );
$c->minion->enqueue( 'deploy_blog', [ $blog->id ] );
my $build_job_id = $c->minion->enqueue( 'deploy_blog', [ $blog->id ] );
$blog->create_related( 'builds', { job_id => $build_job_id } );
$c->flash( confirmation => "Updated <strong>$title</strong>!" );
$c->redirect_to( $c->url_for( 'show_dashboard_blog_posts', { id => $blog->id } ) );
@ -144,7 +145,8 @@ sub do_blog_post_create ( $c ) {
$jekyll->write_post( $post );
$c->minion->enqueue( 'deploy_blog', [ $blog->id ] );
my $build_job_id = $c->minion->enqueue( 'deploy_blog', [ $blog->id ] );
$blog->create_related( 'builds', { job_id => $build_job_id } );
$c->flash( confirmation => "Created <strong>$title</strong>!" );
$c->redirect_to( $c->url_for( 'show_dashboard_blog_posts', { id => $blog->id } ) );

Loading…
Cancel
Save