1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-11-09 01:27:18 +00:00
Go to file
2018-04-14 02:42:08 +02:00
controller Initial commit, first version of test TFW project 2018-03-23 15:27:42 +01:00
hack Make bootstrap script clean up after itself in case of errors 2018-04-14 02:42:08 +02:00
solvable Add .bashrc path to TestCommands instance 2018-04-12 11:08:58 +02:00
.dockerignore Add .dockerignore to avoid choking poor Docker on JS crapware 2018-03-31 20:00:49 +02:00
config.yml Update project to comply user separation 2018-04-04 17:44:14 +02:00
README.md Update oneliner to support custom install arguments 2018-04-03 11:43:46 +02:00

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.