From 88d5e00f9976325c48e4e93a75749526c0f30449 Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Mon, 25 Jan 2021 13:46:20 -0500 Subject: [PATCH] Update UI staging build for vercel hosting (#9628) * update ui staging for vercel * move vercel.json * add a couple more settings * fix comments --- ui/GNUmakefile | 15 +++++++-------- ui/packages/consul-ui/_redirects | 2 -- ui/vercel.json | 6 ++++++ 3 files changed, 13 insertions(+), 10 deletions(-) delete mode 100644 ui/packages/consul-ui/_redirects create mode 100644 ui/vercel.json diff --git a/ui/GNUmakefile b/ui/GNUmakefile index 0f64910033..9ac27c10b2 100644 --- a/ui/GNUmakefile +++ b/ui/GNUmakefile @@ -21,19 +21,18 @@ dist: clean CONSUL_UI_INSTALL_FLAGS=--focus \ $(MAKE) -# Build a distribution of the UI for Netlify previews. +# Build a distribution of the UI for Vercel previews. # The distribution must be copied into the ui/ subfolder # in order to mirror the go binary # -# Netlify Settings: +# Vercel Settings: # --- -# base-directory: ui -# build command: make dist-netlify -# publish directory: ui/dist -dist-netlify: clean +# Base Directory: ui +# Build Command: make dist-netlify +# Publish Directory: ui/dist +dist-vercel: clean mkdir -p dist/ui && \ cd packages/consul-ui && \ CONSUL_UI_INSTALL_FLAGS=--focus \ $(MAKE) build-staging && \ - mv dist/* ../../dist/ui && \ - cp _redirects ../../dist/_redirects + mv dist/* ../../dist/ui diff --git a/ui/packages/consul-ui/_redirects b/ui/packages/consul-ui/_redirects deleted file mode 100644 index 3f6c546aab..0000000000 --- a/ui/packages/consul-ui/_redirects +++ /dev/null @@ -1,2 +0,0 @@ -/ /ui -/ui/* /ui/index.html 200 diff --git a/ui/vercel.json b/ui/vercel.json new file mode 100644 index 0000000000..bed52f5ac9 --- /dev/null +++ b/ui/vercel.json @@ -0,0 +1,6 @@ +{ + "public": true, + "github": { "silent": true }, + "redirects": [{ "source": "/", "destination": "/ui/" }], + "rewrites": [{ "source": "/ui/(.*)", "destination": "/ui/index.html" }] +}