Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(scripts): additional scripts to start and simplify development
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
|
||
set -e -u -x | ||
|
||
## Building Frontend part with cache in Docker | ||
|
||
|
||
NODE_IMAGE=node:9 | ||
|
||
docker pull $NODE_IMAGE | ||
|
||
docker run --rm -it \ | ||
--env .env \ | ||
--volume $(pwd):/src \ | ||
--workdir /src \ | ||
$NODE_IMAGE \ | ||
/bin/bash /src/scripts/build-frontend.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
set -e -u -x | ||
|
||
if [ ! -d _assets ]; then | ||
## TODO: make sure asserts are up-to-date... | ||
|
||
## Building Frontend part with cache in Docker | ||
echo "" | ||
echo "Building assets..." | ||
echo "" | ||
|
||
./build-assets.sh | ||
|
||
|
||
echo "" | ||
echo "Assets built!" | ||
echo "" | ||
fi | ||
|
||
## Running dev server | ||
|
||
# build kotlin-web-site container here | ||
docker build --pull -t kotlin-web-site . | ||
|
||
while true; do | ||
echo "" | ||
echo "Running Python web server..." | ||
echo "" | ||
|
||
docker run -it --rm \ | ||
-v $(pwd):/src \ | ||
-p 5000:5000 \ | ||
kotlin-web-site \ | ||
python /src/kotlin-website.py $@ | ||
|
||
EXIT_CODE=$? | ||
|
||
echo "" | ||
echo "Python existed with $EXIT_CODE" | ||
echo "Restarting..." | ||
sleep 5 | ||
done | ||
|
||
|
||
|