1
0

improve build config for heroku

This commit is contained in:
Michael Schramm 2020-06-03 13:50:07 +02:00
parent d3f463d801
commit c0ef337a3d
4 changed files with 18 additions and 13 deletions

@ -1,4 +1,3 @@
{
"name": "ohmyform",
"description": "Opensource alternative to TypeForm",
@ -51,8 +50,5 @@
{
"url": "heroku/nodejs"
}
],
"scripts": {
"postdeploy": "scripts/heroku/postdeploy.sh"
}
]
}

@ -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"
}
}

@ -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"

12
scripts/heroku/prebuild.sh Executable file

@ -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"