From 3aa642be18c95766bfaaf69922a4184974da978a Mon Sep 17 00:00:00 2001 From: Frantz Kati Date: Tue, 20 Jun 2023 16:25:37 +0100 Subject: [PATCH] feat: add `flightcontrol` preset (#970) (#1250) Co-authored-by: ModupeD <69601432+ModupeD@users.noreply.github.com> Co-authored-by: Pooya Parsa --- .../2.deploy/providers/flightcontrol.md | 66 +++++++++++++++++++ src/presets/flightcontrol.ts | 5 ++ src/presets/index.ts | 1 + 3 files changed, 72 insertions(+) create mode 100644 docs/content/2.deploy/providers/flightcontrol.md create mode 100644 src/presets/flightcontrol.ts diff --git a/docs/content/2.deploy/providers/flightcontrol.md b/docs/content/2.deploy/providers/flightcontrol.md new file mode 100644 index 0000000000..67b4d1f18a --- /dev/null +++ b/docs/content/2.deploy/providers/flightcontrol.md @@ -0,0 +1,66 @@ +# Flightcontrol + +**Preset:** `flightcontrol` ([switch to this preset](/deploy/#changing-the-deployment-preset)) + +Nitro supports deploying to [AWS via Flightcontrol](https://flightcontrol.dev?ref=nitro) with minimal configuration. + +::alert +Flight control has zero config support for [Nuxt](https://nuxt.com/) projects. +:: + +### Set Up your Flightcontrol account + +On a high level, the steps you will need to follow to deploy a project for the first time are: + +1. Create an account at [Flightcontrol](https://app.flightcontrol.dev/signup?ref=nitro) +2. Create an account at [AWS](https://portal.aws.amazon.com/billing/signup) (if you don't already have one) +3. Link your AWS account to the FlightControl +4. Authorize the Flightcontrol GitHub App to access your chosen repositories, public or private. +5. Create a Flightcontrol project with configuration via the Dashboard or with configuration via `flightcontrol.json`. + +### Create a Project with Configuration via the Dashboard + +1. Create a Flightcontrol project from the Dashboard. Select a repository for the source. +2. Select the `GUI` config type. +3. Select the Nuxt preset. This preset will also work for any Nitro-based applications. +4. Select your preferred AWS server size. +5. Submit the new project form. + +### Create a Project with Configuration via `flightcontrol.json` + +1. Create a Flightcontrol project from your dashboard. Select a repository for the source. +2. Select the `flightcontrol.json` config type. +3. Add a new file at the root of your repository called `flightcontrol.json`. Here is an example configuration that creates an AWS fargate service for your app: + +```json +{ + "$schema": "https://app.flightcontrol.dev/schema.json", + "environments": [ + { + "id": "production", + "name": "Production", + "region": "us-west-2", + "source": { + "branch": "main" + }, + "services": [ + { + "id": "nitro", + "buildType": "nixpacks", + "name": "My Nitro site", + "type": "fargate", + "domain": "www.yourdomain.com", + "outputDirectory": ".output", + "startCommand": "node .output/server/index.mjs", + "cpu": 0.25, + "memory": 0.5 + } + ] + } + ] +} +``` + +4. Submit the new project form. + +Learn more about Flightcontrol's [configuration](https://www.flightcontrol.dev/docs?ref=nitro). diff --git a/src/presets/flightcontrol.ts b/src/presets/flightcontrol.ts new file mode 100644 index 0000000000..1401507f8a --- /dev/null +++ b/src/presets/flightcontrol.ts @@ -0,0 +1,5 @@ +import { defineNitroPreset } from "../preset"; + +export const flightControl = defineNitroPreset({ + extends: "node-server", +}); diff --git a/src/presets/index.ts b/src/presets/index.ts index f208813c88..6faaf29f88 100644 --- a/src/presets/index.ts +++ b/src/presets/index.ts @@ -24,6 +24,7 @@ export * from "./stormkit"; export * from "./vercel"; export * from "./cleavr"; export * from "./layer0"; +export * from "./flightcontrol"; export * from "./lagon"; export { _static as static } from "./static"; export * from "./github-pages";