-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the `doc` folder, because putting everything for two build systems in the README was cluttered. Moved `/build.sh` to `/build/compile.sh`.
- Loading branch information
1 parent
12275ab
commit 9fcaae9
Showing
8 changed files
with
130 additions
and
14 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,21 @@ | ||
# auto generated or typically secret | ||
**/dist | ||
**/node_modules/ | ||
**/vendor | ||
.git | ||
npm-debug.log | ||
.coverage | ||
.coverage.* | ||
.env | ||
.aws | ||
build/.install | ||
|
||
# developer-facing | ||
build/Dockerfile | ||
*.md | ||
.editorconfig | ||
.git | ||
.idea | ||
.vscode | ||
# if we get more swapfiles than this, we should probably fix vim first... | ||
**/.*.sw[a-p] |
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
|
||
/dist/ | ||
/node_modules/ | ||
/build/.install |
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
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,9 @@ | ||
FROM docker.io/library/node:lts | ||
RUN npm install --global http-server | ||
ENV MODE=--dev | ||
ENV PORT=9001 | ||
|
||
COPY . /app | ||
RUN ["/bin/sh", "-c", "/app/build/compile.sh $MODE"] | ||
EXPOSE ${PORT} | ||
CMD ["/bin/sh", "-c", "cd /app/dist && http-server"] |
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
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,10 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
cd "$(dirname "$0")/.." | ||
cmd=podman | ||
if ! command -v podman >/dev/null 2>&1 ; then | ||
cmd=docker | ||
fi | ||
|
||
exec "${cmd}" build -t quilt-draw:latest -f build/Containerfile . |
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,28 @@ | ||
# Container mode, podman/Docker | ||
|
||
This documentation is part of the [Quilt Draw](../) project. | ||
|
||
Due to licensing concerns, these directions will feature the `podman` | ||
command, but changing “podman” to “docker” is expected to be compatible | ||
if the Docker engine is in use. | ||
|
||
## Manual (re)build | ||
|
||
1. Change to the repository directory | ||
2. `podman build -t quilt-draw:latest -f build/Containerfile .` _or_ | ||
on macOS/Linux, `./build/container.sh` | ||
|
||
This (always) builds **an image** tagged `quilt-draw:latest`. | ||
It does not start a container; that is discussed below. | ||
|
||
## Running the container | ||
|
||
* `podman run -it -p 9001:9001 quilt-draw:latest` | ||
* Navigate to [localhost:9001](http://localhost:9001/) | ||
|
||
The container always listens on port 9001. To use a different port, | ||
for example 8080, change the left side of the port-binding value: | ||
|
||
podman run --rm -it -p 8080:9001 quilt-draw:latest | ||
|
||
Use Ctrl+C to stop the container. |
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,36 @@ | ||
# Host-side mode, macOS/Linux | ||
|
||
This documentation is part of the [Quilt Draw](../) project. | ||
|
||
## Initial setup | ||
|
||
1. Get [Yarn 1.x](https://classic.yarnpkg.com/) if you need it; `npm i -g yarn` | ||
|
||
## Manual rebuild | ||
|
||
1. Change to the repository directory | ||
2. `./build/compile.sh -d` to do an initial build of the project: | ||
the `-d` is for development mode | ||
|
||
_NOTE:_ When run without options, `./build/compile.sh` will create a | ||
release (aka minified) version. | ||
|
||
## Ongoing development option | ||
|
||
* `yarn run dev-server` | ||
* Open [localhost:8080](http://localhost:8080/) in your browser | ||
|
||
This will only automatically pick up changes to `src/app.ts`. Other changes | ||
need copied over (from `src` to `dist`) manually. | ||
|
||
## Serving the files | ||
|
||
Assuming you are still in the repository directory, | ||
one of the following may work to serve the `dist` directory | ||
at an address of [localhost:9001](http://localhost:9001/): | ||
|
||
* `python3 -m http.server -d dist 9001` | ||
* `php -t dist -S localhost:9001` | ||
* `ruby -run -e httpd dist -p 9001` | ||
|
||
(Why 9001? _[It’s over 9000!](https://en.wikipedia.org/wiki/It%27s_Over_9000!)_) |