Add a versioned web-node deployment manifest
Export the account ID and domain from a completed preview. Render matching Apache and PHP-FPM configuration on the web node.
This commit is contained in:
1 parent
a12d428023
commit
aea049087d
15 files changed
+239
-44
No files matched your search
@@ -7,7 +7,7 @@ from django.views.generic import CreateView, DetailView, ListView, UpdateView
|
||||
from django.views.generic.detail import SingleObjectMixin
|
||||
|
||||
from .models import HostingAccount, WebProvisioningPlan
|
||||
from .web_node import build_web_smoke_bundle
|
||||
from .web_node import build_web_smoke_bundle, serialize_deployment_manifest
|
||||
|
||||
VIEW_ACCOUNTS = "hosting.view_hostingaccount"
|
||||
CHANGE_ACCOUNTS = "hosting.change_hostingaccount"
|
||||
@@ -97,7 +97,9 @@ class PlanDetail(PermissionRequiredMixin, DetailView):
|
||||
context_object_name = "plan"
|
||||
|
||||
|
||||
class DownloadWebSmokeBundle(PlanDetail):
|
||||
class DownloadWebPlan(PlanDetail):
|
||||
manifest = False
|
||||
|
||||
def render_to_response(self, context, **response_kwargs):
|
||||
plan = self.object
|
||||
if not plan.can_export:
|
||||
@@ -107,11 +109,21 @@ class DownloadWebSmokeBundle(PlanDetail):
|
||||
content_type="text/plain",
|
||||
)
|
||||
|
||||
if self.manifest:
|
||||
content = serialize_deployment_manifest(plan)
|
||||
extension = "json"
|
||||
content_type = "application/json"
|
||||
else:
|
||||
content = build_web_smoke_bundle(plan)
|
||||
extension = "tar"
|
||||
content_type = "application/x-tar"
|
||||
return HttpResponse(
|
||||
build_web_smoke_bundle(plan),
|
||||
content_type="application/x-tar",
|
||||
content,
|
||||
content_type=content_type,
|
||||
headers={
|
||||
"Cache-Control": "private, no-store",
|
||||
"Content-Disposition": f'attachment; filename="coulobre-web-plan-{plan.pk}.tar"',
|
||||
"Content-Disposition": (
|
||||
f'attachment; filename="coulobre-web-plan-{plan.pk}.{extension}"'
|
||||
),
|
||||
},
|
||||
)
|
||||
Reference in new issue
Block a user