Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates from experience deploying with FlightControl #11656

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 88 additions & 9 deletions docs/docs/deploy/flightcontrol.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,92 @@ description: How to deploy a Redwood app to AWS via Flightcontrol
## Flightcontrol Deploy Setup

1. In your project, run the command `yarn rw setup deploy flightcontrol --database=YOUR_DB_TYPE` where YOUR_DB_TYPE is `mysql` or `postgresql`
2. Commit the changes and push to github.
3. If you don't have an account, sign up at [app.flightcontrol.dev/signup](https://app.flightcontrol.dev/signup?ref=redwood).
4. Create a new project.
1. Connect your GitHub account and select your repo.
2. Click the Redwood preset
3. Click "Create project" (do not add services to the UI during this step, the flightcontrol.json you added will be used for service config)
5. After project is created, add your env vars under Environment Settings.
1. If using dbAuth, add the session secret key env variable in the Flightcontrol dashboard.
2. NOTE: The RedwoodJS Flightcontrol sets up an array of environments and defaults you to the 1st one: 'Development', add to the array to deploy more environments.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. NOTE: The RedwoodJS Flightcontrol sets up an array of environments and defaults you to the 1st one: 'Development', add to the array to deploy more environments.
- This will create a `flightcontrol.json` file with an array of environments. It defaults with a single Development environment. Add to the array to deploy more environments.

3. Commit the changes and push to github.
4. If you don't have an account, sign up at [app.flightcontrol.dev/signup](https://app.flightcontrol.dev/signup?ref=redwood).
5. Create a new project from the onboarding screen or project list.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
5. Create a new project from the onboarding screen or project list.
5. Create a new project.

1. Connect your Github account and select your repo.
2. Click "Create Project" and complete any required steps like linking your AWS account.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
2. Click "Create Project" and complete any required steps like linking your AWS account.
2. Click "Create project"

3. Configuration Type should autoselect as `flightcontrol.json`.
4. NOTE: `flightcontrol.json` is now the source of truth for your Project and its Environments.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
4. NOTE: `flightcontrol.json` is now the source of truth for your Project and its Environments.
- `flightcontrol.json` is now the source of truth for your Project and its Environments.

6. Add your env vars in Flightcontrol for your Environment.
7. If using dbAuth, add the session secret key env variable in the Flightcontrol dashboard.
Comment on lines +20 to +21
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
6. Add your env vars in Flightcontrol for your Environment.
7. If using dbAuth, add the session secret key env variable in the Flightcontrol dashboard.
5. After project is created, add your env vars under Environment Settings.
1. If using dbAuth, add the session secret key env variable in the Flightcontrol dashboard.

8. To tear down your project w/Flight control go to your dashboard and the 'Danger Zone' and choose delete.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
8. To tear down your project w/Flight control go to your dashboard and the 'Danger Zone' and choose delete.
8. To tear down your project, go to the Flightcontrol dashboard, click on the Project settings icon, and then choose destroy in the 'Danger Zone' tab.


If you have _any_ problems or questions, Flightcontrol is very responsive. [See their support options](https://www.flightcontrol.dev/docs/troubleshooting/contacting-support).
If you have *any* problems or questions, Flightcontrol is very responsive in [their support Discord](https://discord.gg/yY8rSPrD6q).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you have *any* problems or questions, Flightcontrol is very responsive in [their support Discord](https://discord.gg/yY8rSPrD6q).
If you have _any_ problems or questions, Flightcontrol is very responsive. [See their support options](https://www.flightcontrol.dev/docs/troubleshooting/contacting-support).


This was a working `flightcontrol.json` configuration

```
{
"$schema": "https://app.flightcontrol.dev/schema.json",
"environments": [
{
"id": "staging",
"name": "Staging",
"region": "us-east-1",
"source": {
"branch": "staging"
},
"services": [
{
"id": "redwood-api",
"name": "Redwood API",
"type": "fargate",
"buildType": "nixpacks",
"cpu": 0.5,
"memory": 1,
"installCommand": "corepack enable && yarn install",
"buildCommand": "yarn rw deploy flightcontrol api",
"startCommand": "yarn rw deploy flightcontrol api --serve",
"port": 8911,
"healthCheckPath": "/graphql/health",
"envVariables": {
"REDWOOD_WEB_URL": {
"fromService": {
"id": "redwood-web",
"value": "origin"
}
},
"DATABASE_URL": {
"fromService": {
"id": "db",
"value": "dbConnectionString"
}
}
}
},
{
"id": "redwood-web",
"name": "Redwood Web",
"type": "static",
"buildType": "nixpacks",
"singlePageApp": true,
"installCommand": "corepack enable && yarn install",
"buildCommand": "yarn rw deploy flightcontrol web",
"outputDirectory": "web/dist",
"envVariables": {
"REDWOOD_API_URL": {
"fromService": {
"id": "redwood-api",
"value": "origin"
}
}
}
},
{
"id": "db",
"name": "Database",
"type": "rds",
"engine": "postgres",
"engineVersion": "12",
"instanceSize": "db.t4g.micro",
"port": 5432,
"storage": 20,
"private": false
}
]
}
]
}
```
Loading