You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4
Original file line number
Diff line number
Diff line change
@@ -148,6 +148,10 @@ After using this generator, your new project (the directory created) will contai
148
148
149
149
### Next release
150
150
151
+
* Fix locations of scripts in generated README. PR [#19](https://github.com./tiangolo/full-stack-fastapi-postgresql/pull/19) by [@ebreton](https://github.com./ebreton).
152
+
153
+
* Forward arguments from script to `pytest` inside container. PR [#17](https://github.com./tiangolo/full-stack-fastapi-postgresql/pull/17) by [@ebreton](https://github.com./ebreton).
154
+
151
155
* Update development scripts.
152
156
153
157
* Read Alembic configs from env vars. PR <ahref="https://github.com./tiangolo/full-stack-fastapi-postgresql/pull/9"target="_blank">#9</a> by <ahref="https://github.com./ebreton"target="_blank">@ebreton</a>.
Copy file name to clipboardExpand all lines: {{cookiecutter.project_slug}}/README.md
+26-10
Original file line number
Diff line number
Diff line change
@@ -123,17 +123,33 @@ Nevertheless, if it doesn't detect a change but a syntax error, it will just sto
123
123
To test the backend run:
124
124
125
125
```bash
126
-
DOMAIN=backend sh ./script-test.sh
126
+
DOMAIN=backend sh ./scripts/test.sh
127
127
```
128
128
129
-
The file `./script-test.sh` has the commands to generate a testing `docker-stack.yml` file from the needed Docker Compose files, start the stack and test it.
129
+
The file `./scripts/test.sh` has the commands to generate a testing `docker-stack.yml` file from the needed Docker Compose files, start the stack and test it.
130
130
131
131
The tests run with Pytest, modify and add tests to `./backend/app/app/tests/`.
132
132
133
133
If you need to install any additional package for the tests, add it to the file `./backend/app/tests.dockerfile`.
134
134
135
135
If you use GitLab CI the tests will run automatically.
136
136
137
+
#### Test running stack
138
+
139
+
If your stack is already up and you just want to run the tests, you can use:
140
+
141
+
```bash
142
+
docker-compose exec backend-tests /tests-start.sh
143
+
```
144
+
145
+
That `/tests-start.sh` script inside the `backend-tests` container calls `pytest`. If you need to pass extra arguments to `pytest`, you can pass them to that command and they will be forwarded.
### Live development with Python Jupyter Notebooks
138
154
139
155
If you know about Python [Jupyter Notebooks](http://jupyter.org/), you can take advantage of them during local development.
@@ -384,7 +400,7 @@ Then you need to have those constraints in your deployment Docker Compose file f
384
400
To be able to use different environments, like `prod` and `stag`, you should pass the name of the stack as an environment variable. Like:
385
401
386
402
```bash
387
-
STACK_NAME={{cookiecutter.docker_swarm_stack_name_staging}} sh ./script-deploy.sh
403
+
STACK_NAME={{cookiecutter.docker_swarm_stack_name_staging}} sh ./scripts/deploy.sh
388
404
```
389
405
390
406
To use and expand that environment variable inside the `docker-compose.deploy.volumes-placement.yml` files you can add the constraints to the services like:
@@ -401,7 +417,7 @@ services:
401
417
- node.labels.${STACK_NAME}.app-db-data == true
402
418
```
403
419
404
-
note the `${STACK_NAME}`. In the script `./script-deploy.sh`, that `docker-compose.deploy.volumes-placement.yml` would be converted, and saved to a file `docker-stack.yml` containing:
420
+
note the `${STACK_NAME}`. In the script `./scripts/deploy.sh`, that `docker-compose.deploy.volumes-placement.yml` would be converted, and saved to a file `docker-stack.yml` containing:
405
421
406
422
```yaml
407
423
version: '3'
@@ -490,10 +506,10 @@ Here are the steps in detail:
490
506
* Set these environment variables, prepended to the next command:
491
507
* `TAG=prod`
492
508
* `FRONTEND_ENV=production`
493
-
* Use the provided `script-build.sh` file with those environment variables:
509
+
* Use the provided `scripts/build.sh` file with those environment variables:
0 commit comments