From 2181230d96e2ca7d69b071493380d7bf8337cc17 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Fri, 12 Feb 2021 18:22:43 -0500 Subject: [PATCH 1/3] added auto-update section --- INSTALLATION.md | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/INSTALLATION.md b/INSTALLATION.md index 67cb10a..6ad0af6 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -138,11 +138,11 @@ sudo ufw status You should now have an up and running BirdsiteLIVE instance! -## Upgrading +## Updating Make sure your data belong outside the containers before migrating (set by default). -To upgrade your installation to the latest release: +To update your installation to the latest release: ``` # Edit `docker-compose.yml` to update the version, if you have one specified @@ -152,6 +152,37 @@ docker-compose pull docker-compose up -d ``` +## Auto-Updating + +To set auto-updates on your deployment, add to the `docker-compose.yml` file this section: + +```diff +version: "3" + +networks: + birdsitelivenetwork: + external: false + +services: + server: + image: nicolasconstant/birdsitelive:latest + [...] + + db: + image: postgres:9.6 + [...] + ++ watchtower: ++ image: containrrr/watchtower ++ restart: always ++ container_name: watchtower ++ environment: ++ - WATCHTOWER_CLEANUP=true ++ volumes: ++ - /var/run/docker.sock:/var/run/docker.sock ++ command: --interval 300 +``` + ## More options -You can find more options available [here](https://github.com/NicolasConstant/BirdsiteLive/blob/master/VARIABLES.md) \ No newline at end of file +You can find more options available [here](https://github.com/NicolasConstant/BirdsiteLive/blob/master/VARIABLES.md) From 30bd16447f3b0ea9e942fbedb1046eb6ebf12a6e Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Sat, 13 Feb 2021 21:17:48 -0500 Subject: [PATCH 2/3] stop application if worker fails --- src/BirdsiteLive/Services/FederationService.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/BirdsiteLive/Services/FederationService.cs b/src/BirdsiteLive/Services/FederationService.cs index 9acab41..7ff4c1f 100644 --- a/src/BirdsiteLive/Services/FederationService.cs +++ b/src/BirdsiteLive/Services/FederationService.cs @@ -13,19 +13,28 @@ namespace BirdsiteLive.Services { private readonly IDatabaseInitializer _databaseInitializer; private readonly IStatusPublicationPipeline _statusPublicationPipeline; + private readonly IHostApplicationLifetime _applicationLifetime; #region Ctor - public FederationService(IDatabaseInitializer databaseInitializer, IStatusPublicationPipeline statusPublicationPipeline) + public FederationService(IDatabaseInitializer databaseInitializer, IStatusPublicationPipeline statusPublicationPipeline, IHostApplicationLifetime applicationLifetime) { _databaseInitializer = databaseInitializer; _statusPublicationPipeline = statusPublicationPipeline; + _applicationLifetime = applicationLifetime; } #endregion protected override async Task ExecuteAsync(CancellationToken stoppingToken) { - await _databaseInitializer.InitAndMigrateDbAsync(); - await _statusPublicationPipeline.ExecuteAsync(stoppingToken); + try + { + await _databaseInitializer.InitAndMigrateDbAsync(); + await _statusPublicationPipeline.ExecuteAsync(stoppingToken); + } + finally + { + _applicationLifetime.StopApplication(); + } } } } \ No newline at end of file From bc6fe941015bc8baf63065a86c261385ac1f0599 Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Sat, 13 Feb 2021 21:18:28 -0500 Subject: [PATCH 3/3] road to 0.14.4 --- src/BirdsiteLive/BirdsiteLive.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BirdsiteLive/BirdsiteLive.csproj b/src/BirdsiteLive/BirdsiteLive.csproj index 26df777..8b8febc 100644 --- a/src/BirdsiteLive/BirdsiteLive.csproj +++ b/src/BirdsiteLive/BirdsiteLive.csproj @@ -4,7 +4,7 @@ netcoreapp3.1 d21486de-a812-47eb-a419-05682bb68856 Linux - 0.14.3 + 0.14.4