forked from StudioInfinity/dyna3
Make deployment script more like examples script
This commit is contained in:
parent
203e47397d
commit
b1d5db2dc2
3 changed files with 18 additions and 18 deletions
|
@ -70,11 +70,11 @@ The latest prototype is in the folder `app-proto`. It includes both a user inter
|
||||||
|
|
||||||
1. From the `app-proto` folder, call `trunk build --release`.
|
1. From the `app-proto` folder, call `trunk build --release`.
|
||||||
- Building in [release mode](https://doc.rust-lang.org/cargo/reference/profiles.html#release) produces an executable which is smaller and often much faster, but harder to debug and more time-consuming to build.
|
- Building in [release mode](https://doc.rust-lang.org/cargo/reference/profiles.html#release) produces an executable which is smaller and often much faster, but harder to debug and more time-consuming to build.
|
||||||
2. Use `bash` to run the packaging script `tools/package-for-deployment.bash`.
|
2. Use `sh` to run the packaging script `tools/package-for-deployment.sh`.
|
||||||
- The script is location-independent, so you can do this from anywhere in the dyna3 repository.
|
- The script is location-independent, so you can do this from anywhere in the dyna3 repository.
|
||||||
- The call from the top level of the repository is:
|
- The call from the top level of the repository is:
|
||||||
```bash
|
```bash
|
||||||
bash tools/package-for-deployment.bash
|
sh tools/package-for-deployment.sh
|
||||||
```
|
```
|
||||||
- This will overwrite or replace the files in `deploy/dyna3`.
|
- This will overwrite or replace the files in `deploy/dyna3`.
|
||||||
3. Put the contents of `deploy/dyna3` in the folder on your server that the prototype will be served from.
|
3. Put the contents of `deploy/dyna3` in the folder on your server that the prototype will be served from.
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
# set paths. this technique for getting the script location comes from
|
|
||||||
# `mklement0` on Stack Overflow
|
|
||||||
#
|
|
||||||
# https://stackoverflow.com/a/24114056
|
|
||||||
#
|
|
||||||
tools=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")")
|
|
||||||
src="$tools/../app-proto/dist"
|
|
||||||
dest="$tools/../deploy/dyna3"
|
|
||||||
|
|
||||||
# remove the old hash-named files
|
|
||||||
[ -e "$dest"/dyna3-*.js ] && rm "$dest"/dyna3-*.js
|
|
||||||
[ -e "$dest"/dyna3-*.wasm ] && rm "$dest"/dyna3-*.wasm
|
|
||||||
[ -e "$dest"/main-*.css ] && rm "$dest"/main-*.css
|
|
||||||
|
|
||||||
# copy the distribution
|
|
||||||
cp -r "$src/." "$dest"
|
|
16
tools/package-for-deployment.sh
Normal file
16
tools/package-for-deployment.sh
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# set paths. this technique for getting the script location comes from
|
||||||
|
# `mklement0` on Stack Overflow
|
||||||
|
#
|
||||||
|
# https://stackoverflow.com/a/24114056
|
||||||
|
#
|
||||||
|
TOOLS=$(dirname -- $0)
|
||||||
|
SRC="$TOOLS/../app-proto/dist"
|
||||||
|
DEST="$TOOLS/../deploy/dyna3"
|
||||||
|
|
||||||
|
# remove the old hash-named files
|
||||||
|
[ -e "$DEST"/dyna3-*.js ] && rm "$DEST"/dyna3-*.js
|
||||||
|
[ -e "$DEST"/dyna3-*.wasm ] && rm "$DEST"/dyna3-*.wasm
|
||||||
|
[ -e "$DEST"/main-*.css ] && rm "$DEST"/main-*.css
|
||||||
|
|
||||||
|
# copy the distribution
|
||||||
|
cp -r "$SRC/." "$DEST"
|
Loading…
Add table
Add a link
Reference in a new issue