From 37c929974ad9eb890bf47df742e2638f5e627ef7 Mon Sep 17 00:00:00 2001 From: bryk Date: Fri, 27 Nov 2015 09:36:54 +0100 Subject: [PATCH] Fix issue where devs couldn't run serve:prod This was caused by the wait-for-cluster rule which never finished. I've moved it to local-up-cluster. Everything works now as expected. --- build/cluster.js | 2 +- build/serve.js | 24 +++++++++++------------- src/app/backend/dashboard.go | 8 -------- 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/build/cluster.js b/build/cluster.js index f9b0570d2..6cfe31f2f 100644 --- a/build/cluster.js +++ b/build/cluster.js @@ -88,7 +88,7 @@ function executeKubectlCommand(command, doneFn) { * * Install golang * * Install etcd */ -gulp.task('local-up-cluster', ['spawn-cluster']); +gulp.task('local-up-cluster', ['spawn-cluster', 'wait-for-cluster']); /** * Tears down a Kubernetes cluster. diff --git a/build/serve.js b/build/serve.js index 4395ab3a6..797d1582b 100644 --- a/build/serve.js +++ b/build/serve.js @@ -127,19 +127,17 @@ gulp.task('spawn-backend', ['backend', 'kill-backend'], function() { * backend process is killed beforehand, if any. In production the backend does serve the frontend * pages as well. */ -gulp.task( - 'spawn-backend:prod', ['build-frontend', 'backend:prod', 'kill-backend', 'wait-for-cluster'], - function() { - runningBackendProcess = child.spawn( - path.join(conf.paths.dist, conf.backend.binaryName), - [`--apiserver-host=${conf.backend.apiServerHost}`, `--port=${conf.frontend.serverPort}`], - {stdio: 'inherit', cwd: conf.paths.dist}); - - runningBackendProcess.on('exit', function() { - // Mark that there is no backend process running anymore. - runningBackendProcess = null; - }); - }); +gulp.task('spawn-backend:prod', ['build-frontend', 'backend:prod', 'kill-backend'], function() { + runningBackendProcess = child.spawn( + path.join(conf.paths.dist, conf.backend.binaryName), + [`--apiserver-host=${conf.backend.apiServerHost}`, `--port=${conf.frontend.serverPort}`], + {stdio: 'inherit', cwd: conf.paths.dist}); + + runningBackendProcess.on('exit', function() { + // Mark that there is no backend process running anymore. + runningBackendProcess = null; + }); +}); /** * Kills running backend process (if any). diff --git a/src/app/backend/dashboard.go b/src/app/backend/dashboard.go index 9ffec8ccf..510172c9b 100644 --- a/src/app/backend/dashboard.go +++ b/src/app/backend/dashboard.go @@ -43,14 +43,6 @@ func main() { glog.Fatal(err) } - serverAPIVersion, err := apiserverClient.ServerAPIVersions() - if err != nil { - glog.Fatal(err) - } - - // Display Apiserver version. This is just for tests. - println("Server API version: " + serverAPIVersion.GoString()) - // Run a HTTP server that serves static public files from './public' and handles API calls. // TODO(bryk): Disable directory listing. http.Handle("/", http.FileServer(http.Dir("./public"))) -- GitLab