From fccce833c587d6c642fd12995ce4396eca9e75eb Mon Sep 17 00:00:00 2001
From: Frank Sauerburger <frank@sauerburger.com>
Date: Tue, 30 Mar 2021 10:46:43 +0200
Subject: [PATCH] Restart web server after deployment

Recently, deployment frequently results in a Bad Gateway issue. Restarting the
web server resolves the issue. It might be an issue with changing IP addresses.
This commit forces a restart of the web server after each deployment.
---
 .gitlab-ci.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d8b01ad..f48b661 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -85,6 +85,8 @@ build:
     - echo "${CI_REGISTRY_PASSWORD}" | docker login -u ${CI_REGISTRY_USER} --password-stdin ${CI_REGISTRY}
     - docker-compose -f docker-compose.yml -f docker-compose.ci.yml pull -q
     - docker-compose -f docker-compose.yml -f docker-compose.ci.yml up -d
+    - sleep 10
+    - docker-compose -f docker-compose.yml -f docker-compose.ci.yml restart webserver
 
 deploy_staging:
   # Deploy the current image to the production machine.
-- 
GitLab