diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 541589d..dc8fadf 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -6,5 +6,6 @@ jobs: name: Build and test runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - run: echo Hello World \ No newline at end of file + - uses: actions/checkout@v2 + - run: docker build --target test --tag backend:test ./backend/ + - run: docker run --env-file backend/.env backend:test diff --git a/README.md b/README.md index f217c5a..4288784 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,16 @@ From the project root run `docker compose up` Build backend docker image with `docker build --target development --tag backend:dev ./backend/` +Build backend tests docker image with `docker build --target test --tag backend:test ./backend/` + Build the frontend docker image with `docker build --tag frontend:dev ./frontend/` Run backend in development mode from the backend folder with `docker run --env-file .env -p 5000:5000 --mount "type=bind,source=$(pwd)/src,target=/backend/src" backend:dev` Run frontend in development mode from the backend folder with `docker run -it --init --env-file .env -p 1234:1234 --mount "type=bind,source=$(pwd)/src,target=/frontend/src" frontend:dev --entrypoint=/bin/bash` +Run backend tests docker image from the project root with `docker run --env-file backend/.env backend:test` + ## Provisioning VMs with Ansible VMs can be prepared and configured with Ansible from the `/ansible` directory. To set up managed nodes, set the IP addresses in `ansible-inventory`. Your control node will need to have SSH access to these nodes (this can be done from a mac, or another VM with the repo installed).