mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-09-08 19:54:11 +00:00
59 lines
2.7 KiB
Markdown
59 lines
2.7 KiB
Markdown
# tutorial-framework test
|
||
|
||
This is an example playground project built via TFW.
|
||
It is a good starting point to build your own challenges from and will host automated tests in the future.
|
||
|
||
It also gives home to several useful scripts in the `hack` folder to speed up development.
|
||
|
||
## Getting started
|
||
|
||
TFW consists of 3 repositories:
|
||
- `baseimage-tutorial-framework` – Docker baseimage
|
||
- `frontend-tutorial-framework` – Angular frontend
|
||
- `test-tutorial-framework` (this repo)
|
||
|
||
See the documentation of each in their `README.md` files.
|
||
|
||
Getting started with creating challenges using the framework – *setting up a development environment, building, running and such* – is documented here.
|
||
|
||
To learn the stuff you need to know about TFW in order to get started you should consult the `baseimage-tutorial-framework` repo.
|
||
|
||
## Setting up a development environment
|
||
|
||
Just copy and paste the following command in a terminal:
|
||
|
||
`bash -c "$(curl -fsSL https://git.io/vxBfj)"`
|
||
|
||
> You have trust issues regarding the public key infrastructure? You can request a checksum authenticated version of the installer command from our team!
|
||
|
||
This will set up a special version of `test-tutorial-framework` just for you:
|
||
- the latest frontend is included in `solvable/frontend` with dependencies installed
|
||
- `solvable/Dockerfile` is pinned to use the latest TFW baseimage
|
||
|
||
## Building & running
|
||
|
||
### Automated
|
||
|
||
Our magical bash script `hack/tfw.sh` can handle everything for you. Just run it without any arguments to see usage information.
|
||
|
||
It is advisable to run the frontend locally while developing to avoid really looooong build times. The `hack/tfw.sh` script handles this for you automagically.
|
||
|
||
### Doing it manually
|
||
|
||
In case you **must** do it for some reason you can build & run manually.
|
||
Note that this is relatively painful and you should use the `hack/tfw.sh` script when possible.
|
||
|
||
Building without frontend – execute from project root:
|
||
|
||
`docker build -t test-tutorial-framework -f solvable/Dockerfile --build-arg BUILD_CONTEXT=solvable --build-arg NOFRONTEND=1 .`
|
||
|
||
This will create a Docker image without the frontend, which you can run locally. For procudtion builds exclude the argument `--build-arg NOFRONTEND=1` to include a frontend instance.
|
||
|
||
Running – execute:
|
||
|
||
`docker run --rm -p 8888:8888 -e AVATAO_SECRET=secret test-tutorial-framework`
|
||
|
||
In case of a frontendless build (with `--build-arg NOFRONTEND=1`) you will need to run `yarn start` from the `solvable/frontend` directory as well. This will serve the frontend on `http://localhost:4200`.
|
||
|
||
If you've created a production build (without `--build-arg NOFRONTEND=1`) you don't have to run the frontend locally and you can access the challenge on `http://localhost:8888`.
|