From c0ef337a3d14e9a60445bff20cb4cfff0ec022be Mon Sep 17 00:00:00 2001 From: Michael Schramm Date: Wed, 3 Jun 2020 13:50:07 +0200 Subject: [PATCH] improve build config for heroku --- app.json | 6 +----- package.json | 4 ++++ scripts/heroku/{postdeploy.sh => postbuild.sh} | 9 +-------- scripts/heroku/prebuild.sh | 12 ++++++++++++ 4 files changed, 18 insertions(+), 13 deletions(-) rename scripts/heroku/{postdeploy.sh => postbuild.sh} (52%) mode change 100644 => 100755 create mode 100755 scripts/heroku/prebuild.sh diff --git a/app.json b/app.json index f6280a62..1faa108a 100644 --- a/app.json +++ b/app.json @@ -1,4 +1,3 @@ - { "name": "ohmyform", "description": "Opensource alternative to TypeForm", @@ -51,8 +50,5 @@ { "url": "heroku/nodejs" } - ], - "scripts": { - "postdeploy": "scripts/heroku/postdeploy.sh" - } + ] } diff --git a/package.json b/package.json index 5742958c..06a9aaec 100644 --- a/package.json +++ b/package.json @@ -6,5 +6,9 @@ "repository": { "type": "git", "url": "https://github.com/ohmyform/ohmyform.git" + }, + "scripts": { + "heroku-prebuild": "scripts/heroku/prebuild.sh", + "heroku-postbuild": "scripts/heroku/postbuild.sh" } } diff --git a/scripts/heroku/postdeploy.sh b/scripts/heroku/postbuild.sh old mode 100644 new mode 100755 similarity index 52% rename from scripts/heroku/postdeploy.sh rename to scripts/heroku/postbuild.sh index 9111858e..cd59f620 --- a/scripts/heroku/postdeploy.sh +++ b/scripts/heroku/postbuild.sh @@ -1,17 +1,11 @@ cd ui/ -echo "Install UI" -yarn install --frozen-lockfile - echo "Build and Export UI" yarn export cd ../api -echo "Install API" -yarn install --frozen-lockfile - echo "Copy Exported UI to API" cp -r ui/out public @@ -20,5 +14,4 @@ yarn install echo "Build API" yarn build - -echo "FINISHED build for UI and API" +echo "FINISHED postbuild" diff --git a/scripts/heroku/prebuild.sh b/scripts/heroku/prebuild.sh new file mode 100755 index 00000000..b580a8b1 --- /dev/null +++ b/scripts/heroku/prebuild.sh @@ -0,0 +1,12 @@ + +cd ui/ + +echo "Install UI" +yarn install --frozen-lockfile + +cd ../api + +echo "Install API" +yarn install --frozen-lockfile + +echo "FINISHED prebuild"