From 603a8b4d7a2c26cdf40fbd9e58edceb73b8441f3 Mon Sep 17 00:00:00 2001 From: "Cornelius A. Ludmann" Date: Wed, 29 Jul 2020 16:03:05 +0200 Subject: [PATCH] Prepare Gitpod setup for prebuilds (#9560) This commit improves the Gitpod setup. It now allows you to benefit from prebuilds. Also, Gitpod now waits until the server is ready before opening a preview window. --- .gitpod.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index 500c352af..7365367ba 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,8 +1,9 @@ image: file: .gitpod.dockerfile + ports: - port: 3000 - onOpen: open-preview + onOpen: ignore - port: 3035 onOpen: ignore - port: 5432 @@ -13,14 +14,24 @@ ports: onOpen: ignore - port: 9300 onOpen: ignore + tasks: - - command: redis-server - - command: /home/gitpod/elasticsearch-7.5.2/bin/elasticsearch - - init: cp config/sample_application.yml config/application.yml + - name: Forem Server + before: | + redis-server & + /home/gitpod/elasticsearch-7.5.2/bin/elasticsearch & + init: > + cp config/sample_application.yml config/application.yml && + gem install solargraph && + bin/setup command: > - gem install solargraph; - bin/setup && bin/startup + - command: > + gp await-port 3000 && + printf "Waiting for Forem server ..." && + until $(curl -sNL $(gp url 3000) | grep -q "DEV"); do printf '.'; sleep 5; done && echo "" && + gp preview $(gp url 3000) + github: prebuilds: # enable for the master/default branch (defaults to true)