cheatsheets/flynn.md

99 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2015-08-04 02:41:26 +00:00
---
title: Flynn
2015-11-24 05:06:06 +00:00
category: Devops
2015-08-04 02:41:26 +00:00
---
### General workflow
* Start a flynn cluster (on amazon or vagrant)
* `flynn cluster add` to add that cluster
* `flynn create NAME` in your app
* `git push flynn master` to deploy
### Creating a cluster (AWS)
2017-10-19 02:58:05 +00:00
```bash
flynn install # (provisions AWS EC2 stuff)
flynn key add # (adds your pubkey to AWS)
2015-08-04 02:41:26 +00:00
```
2017-10-19 02:58:05 +00:00
#### What it does
2015-08-04 02:41:26 +00:00
* This creates `XXXX.flynnhub.com`
* Dashboard in `dashboard.XXXX.flynnhub.com`
* Use `flynn -a dashboard env get LOGIN_TOKEN` to get login token
* Apps live in `APP.XXXX.flynnhub.com`
### Using a flynn cluster
2017-10-19 02:58:05 +00:00
Managed in `~/.flynnrc`:
{: .-setup}
2015-08-04 02:41:26 +00:00
2017-10-19 02:58:05 +00:00
```bash
2015-08-04 02:41:26 +00:00
flynn cluster
flynn cluster add [-g githost] [-p pin] NAME URL KEY
flynn cluster remove NAME
flynn cluster default NAME # use this current
```
### Setting up a new app
2017-10-19 02:58:05 +00:00
```bash
2015-08-04 02:41:26 +00:00
cd ~/project
flynn create example # adds the `flynn` remote
flynn route # prints http routes
git push flynn master
```
2017-10-19 02:58:05 +00:00
## Commands
2015-08-04 02:41:26 +00:00
### Environment vars
2017-10-19 02:58:05 +00:00
```bash
2015-08-04 02:41:26 +00:00
flynn env
flynn env set FOO=bar BAZ=foobar
flynn env unset FOO
```
### Scale
2017-10-19 02:58:05 +00:00
```bash
2015-08-04 02:41:26 +00:00
flynn ps
flynn scale web=3
```
### Logs
2017-10-19 02:58:05 +00:00
```bash
2015-08-04 02:41:26 +00:00
flynn log
flynn log flynn-d55c7a...
```
### Running commands
2017-10-19 02:58:05 +00:00
```bash
2015-08-04 02:41:26 +00:00
flynn run rake db:migrate
```
### Manage routes
2017-10-19 02:58:05 +00:00
```bash
2015-08-04 02:41:26 +00:00
flynn route
flynn route add http example.com
# then make a CNAME from example.com to myapp.xxxx.flynnhub.com
```
### More
2017-10-19 02:58:05 +00:00
```bash
2015-08-04 02:41:26 +00:00
flynn ps
flynn kill <job>
flynn meta
flynn meta set foo=baz
```
2017-10-19 02:58:05 +00:00
## Also see
- [Flynn website](https://flynn.io/) _(flynn.io)_