Skip to content

Commit

Permalink
Fly.io details
Browse files Browse the repository at this point in the history
Downscale, install git, ...
  • Loading branch information
psonnera committed Jan 13, 2024
1 parent 763203a commit e62a5ff
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/troubleshoot/fly.io.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The web terminal feature was removed from Fly.io.
You need a computer with flyctl.
```

Follow [these instructions](https://fly.io/docs/hands-on/install-flyctl/) to install `flyctl` on your computer.
Follow [these instructions](https://fly.io/docs/hands-on/install-flyctl/) to install `flyctl` on your computer. You also need to [install git](https://git-scm.com/downloads) if you're using a Windows computer.

*Note for Windows: you might experience issues with Git Bash or PowerShell, try an elevated command prompt.*

Expand Down
57 changes: 45 additions & 12 deletions docs/update/dev_branch.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ AAPS users: mind the [compatibility matrix](../nightscout/close_loop.md#aaps)!

Select your platform below:

```{tab-set}
````{tab-set}
:::{tab-item} Select your platform ->
</br>
Expand Down Expand Up @@ -131,22 +131,55 @@ Or whichever version (change `filter tag` find the version) in the [list](https:
:::
:::{tab-item} Fly.io
a) Open a [Web Terminal](/vendors/fly.io/new_user.md#step-2-open-the-web-terminal), and type:</br></br>
`git clone https://github.com/nightscout/cgm-remote-monitor`</br></br>
`cd cgm-remote-monitor`</br></br>
b) Update your local fork</br></br>
Follow [these instructions](https://fly.io/docs/hands-on/install-flyctl/) to install `flyctl` on your computer. You also need to [install git](https://git-scm.com/downloads) if you're using a Windows computer.</br></br>
*Note for Windows: you might experience issues with Git Bash or PowerShell, try an elevated command prompt.*</br></br>
- Log in Fly.io:</br></br>
`flyctl auth login` </br></br>
- Verify your Nightscout app name, use it to replace `example-ns` in the following lines.</br></br>
`flyctl app list`</br></br>
- Verify your app current region (three letters code) and make sure it's in the [free tier](https://fly.io/docs/reference/regions/#fly-io-regions).</br></br>
`flyctl app list`</br></br>
- Navigate to the `cgm-remote-monitor` folder from which you deployed Nightscout on your computer. Verify it contains the `fly.toml` configuration file you used to deploy your site.</br></br>
- If you don't see this file, recover it:</br></br>
`flyctl config save --app example-ns`</br></br>
- If you migrated from Heroku using the wizard, or if you can't find this folder on your computer, follow the next steps to recover your Fly.io configuration:</br></br>
- Fork a copy of the Nightscout repository and change directory</br></br>
`git clone https://github.com/nightscout/cgm-remote-monitor`</br></br>
`cd cgm-remote-monitor`</br></br>
- Download a default `fly.toml` configuration file</br></br>
`flyctl config save --app example-ns`</br></br>
- Update your Nightscout repository</br></br>
`git config pull.rebase true`</br></br>
`git pull origin dev`</br></br>
c) Deploy the changes (replace *yourappname* by the actual name of your fly.io Nightscout app).</br></br>
`flyctl deploy -a yourappname`</br></br>
Deploy will take some time and should complete with the message</br></br>
`Visit your newly deployed app at https://yourappname.fly.dev`</br></br>
d) Don't forget to downscale the app!</br></br>
`flyctl scale count 1`</br></br>
:::
- Edit your `fly.toml` configuration and search this section:</br>
```
[[services]]
protocol = "tcp"
internal_port = 8080
processes = ["app"]
```
- Change the internal port value to 1337, do not change anything else, do not remove the spaces before `internal_port`.</br></br>
`internal_port = 1337`</br></br>
- Save the `fly.toml` file.</br></br>
- Deploy Nightscout:</br></br>
`flyctl launch`</br></br>
- Wait until completion, you site should now be running the latest Nightscout version.</br>
```
Updating existing machines in 'example-ns' with rolling strategy
-------
✔ Machine 1781944ae46438 [app] update succeeded
-------
Visit your newly deployed app at https://example-ns.fly.dev/
```
- Don't forget to downscale the app if you haven't yet!</br></br>
`flyctl scale --app example-ns count 1`</br></br>
</br>
:::
````

</br>

Expand Down
2 changes: 1 addition & 1 deletion docs/update/downgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you use Heroku and you want to return to the previous version, see [Roll back

**Experienced users only - not recommended**

Deploying an archived release of Nightscout is complex and involves installing Git on your computer.
Deploying an archived release of Nightscout is complex and involves using Git on your computer (You need to [install git](https://git-scm.com/downloads) if you're using a Windows computer).

Before starting you need to have the project `nightscout/cgm-remote-monitor` forked in your GitHub repository, with not only the master fork copied (look out for the check box!). It is recommended to [redeploy](/update/redeploy) paying attention to this step.

Expand Down
2 changes: 2 additions & 0 deletions docs/update/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ Updating existing machines in 'example-ns' with rolling strategy
Visit your newly deployed app at https://example-ns.fly.dev/
```
- Downscale the app if you haven't yet
`flyctl scale --app example-ns count 1`
</br>
:::
Expand Down

0 comments on commit e62a5ff

Please sign in to comment.