|
|
|
@ -37,7 +37,12 @@ sub do_create ($c) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Create the Jekyll repo for the site |
|
|
|
# Create the Jekyll repo for the site |
|
|
|
my $jekyll = $c->jekyll($domain)->init; |
|
|
|
# This is where a job to build it on the build server should happen... |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#my $jekyll = $c->jekyll($domain)->init; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my $repo = $c->config->{store_repo_base} . "$domain.git"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my $blog = try { |
|
|
|
my $blog = try { |
|
|
|
$c->db->storage->schema->txn_do( sub { |
|
|
|
$c->db->storage->schema->txn_do( sub { |
|
|
|
@ -52,7 +57,7 @@ sub do_create ($c) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$blog->create_related( 'repoes', { |
|
|
|
$blog->create_related( 'repoes', { |
|
|
|
url => $jekyll->repo, |
|
|
|
url => $repo, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return $blog; |
|
|
|
return $blog; |
|
|
|
@ -64,7 +69,12 @@ sub do_create ($c) { |
|
|
|
# Choose a web server to deploy to |
|
|
|
# Choose a web server to deploy to |
|
|
|
return if $c->stash->{errors}; |
|
|
|
return if $c->stash->{errors}; |
|
|
|
|
|
|
|
|
|
|
|
# Configure DNS to point to the blog |
|
|
|
# Create the blog and add it to git. |
|
|
|
|
|
|
|
my $create_job_id = $c->minion->enqueue( 'create_blog', [ $blog->id ], { |
|
|
|
|
|
|
|
notes => { '_bid_' . $blog->id => 1 }, |
|
|
|
|
|
|
|
priority => $blog->build_priority, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
$blog->create_related( 'builds', { job_id => $create_job_id } ); |
|
|
|
|
|
|
|
|
|
|
|
# Schedule a job to deploy the website |
|
|
|
# Schedule a job to deploy the website |
|
|
|
my $ssl_job_id = $c->minion->enqueue( 'create_ssl_cert', [ $blog->id ], { |
|
|
|
my $ssl_job_id = $c->minion->enqueue( 'create_ssl_cert', [ $blog->id ], { |
|
|
|
|