From e62a5ff71c95a5fc58202a0528cf4c313b251760 Mon Sep 17 00:00:00 2001 From: Patrick Sonnerat Date: Sat, 13 Jan 2024 16:19:57 +0100 Subject: [PATCH] Fly.io details Downscale, install git, ... --- docs/troubleshoot/fly.io.md | 2 +- docs/update/dev_branch.md | 57 +++++++++++++++++++++++++++++-------- docs/update/downgrade.md | 2 +- docs/update/update.md | 2 ++ 4 files changed, 49 insertions(+), 14 deletions(-) diff --git a/docs/troubleshoot/fly.io.md b/docs/troubleshoot/fly.io.md index 2193f4c5..78c1acab 100644 --- a/docs/troubleshoot/fly.io.md +++ b/docs/troubleshoot/fly.io.md @@ -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.* diff --git a/docs/update/dev_branch.md b/docs/update/dev_branch.md index dc74b74f..d8b9aa1d 100644 --- a/docs/update/dev_branch.md +++ b/docs/update/dev_branch.md @@ -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 ->
@@ -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:

-`git clone https://github.com/nightscout/cgm-remote-monitor`

-`cd cgm-remote-monitor`

-b) Update your local fork

+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.*

+- Log in Fly.io:

+`flyctl auth login`

+- Verify your Nightscout app name, use it to replace `example-ns` in the following lines.

+`flyctl app list`

+- 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).

+`flyctl app list`

+- 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.

+ - If you don't see this file, recover it:

+ `flyctl config save --app example-ns`

+- 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:

+ - Fork a copy of the Nightscout repository and change directory

+ `git clone https://github.com/nightscout/cgm-remote-monitor`

+ `cd cgm-remote-monitor`

+ - Download a default `fly.toml` configuration file

+ `flyctl config save --app example-ns`

+- Update your Nightscout repository

`git config pull.rebase true`

`git pull origin dev`

-c) Deploy the changes (replace *yourappname* by the actual name of your fly.io Nightscout app).

-`flyctl deploy -a yourappname`

-Deploy will take some time and should complete with the message

-`Visit your newly deployed app at https://yourappname.fly.dev`

-d) Don't forget to downscale the app!

-`flyctl scale count 1`

-::: +- Edit your `fly.toml` configuration and search this section:
+``` +[[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`.

+`internal_port = 1337`

+- Save the `fly.toml` file.

+- Deploy Nightscout:

+`flyctl launch`

+- Wait until completion, you site should now be running the latest Nightscout version.
+``` +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!

+`flyctl scale --app example-ns count 1`

+
+::: + + +````
diff --git a/docs/update/downgrade.md b/docs/update/downgrade.md index 16b5bffd..edb11b8c 100644 --- a/docs/update/downgrade.md +++ b/docs/update/downgrade.md @@ -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. diff --git a/docs/update/update.md b/docs/update/update.md index 189a6909..32f7dd6b 100644 --- a/docs/update/update.md +++ b/docs/update/update.md @@ -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`
:::