docs: update docs since TACC/Core-CMS#741#755
Conversation
wesleyboar
left a comment
There was a problem hiding this comment.
Notes for reviewers.
|
|
||
| * [Docker] | ||
| * [Docker Engine] ≥ v20 | ||
| * Docker Engine ≥ v20 |
There was a problem hiding this comment.
Cruft. Nothing to link to. Docker Engine is installed via Docker Desktop.
| | For Testing | For Developing & Testing | | ||
| | - | - | | ||
| | `make start` | `docker-compose -f ./docker-compose.dev.yml up` | |
There was a problem hiding this comment.
Some development still requires docker-compose -f ./docker-compose.dev.yml1 e.g. Locally Develop CMS and Styles.
Footnotes
-
Eventually, I might be able to replace it with
make start-dev, but not yet. ↩
| 5. Run the Django Application: | ||
| 5. Update the Django Application: |
There was a problem hiding this comment.
The application is already running via make start or docker compose … up above.
|
|
||
| ```sh | ||
| docker exec -it core_cms /bin/bash | ||
| # This opens a command prompt within the container |
There was a problem hiding this comment.
Just being consistent with other instances of this command in isolation.
| - If CMS `Dockerfile` changed, rebuild Docker Containers: | ||
|
|
||
| ```sh | ||
| make stop | ||
| make build | ||
| make start | ||
| ``` | ||
|
|
||
| - If anything else changed, update the Django application: | ||
|
|
||
| ```sh | ||
| docker exec -it core_cms /bin/bash | ||
| # This opens a command prompt within the container. | ||
| ``` | ||
|
|
||
| Run relevant commands within the container: | ||
| #### For Testing | ||
|
|
||
| - If **styles** changed: | ||
| ```sh | ||
| make stop | ||
| make build | ||
| make start | ||
| ``` | ||
|
|
||
| ```sh | ||
| npm ci | ||
| npm run build:css --project="core-cms" | ||
| python manage.py collectstatic --no-input | ||
| ``` | ||
| #### For Development & Testing | ||
|
|
||
| - If **assets** changed: | ||
|
|
||
| ```sh | ||
| python manage.py collectstatic --no-input | ||
| ``` | ||
|
|
||
| - If **models** changed: | ||
|
|
||
| ```sh | ||
| python manage.py migrate | ||
| ``` | ||
| | If this changed | Run this command | | ||
| | - | - | | ||
| | Dockerfile | `npm ci` | | ||
| | Node dependencies | `npm ci` | | ||
| | CSS stylesheets | `npm run build:css` | | ||
| | UI Demo | `npm run build:ui-demo` | | ||
| | assets e.g.<br><small>images, stylesheets, JavaScript</small> | `docker exec -it core_cms sh -c "python manage.py collectstatic --no-input"` | | ||
| | Python models | `docker exec -it core_cms sh -c "python manage.py migrate"` | |
There was a problem hiding this comment.
I hope this:
- makes use cases clearer
- saves time in the terminal
- teaches what commands do
| 3. Build Assets: | ||
| 2. Build Styles: |
There was a problem hiding this comment.
No assets will ever be built. Only styles.
Details
I had thought maybe they would be, but no. In fact, I plan to remove even building of styles, thus all of Node, from Core-CMS.
| 1. Enter Container: | ||
|
|
||
| ```sh | ||
| docker exec -it core_cms /bin/bash | ||
| # This opens a command prompt within the container. | ||
| ``` |
There was a problem hiding this comment.
No need to enter container in isolation, because only one command need be run in container now, and it can be run inside the container from a command outside the container.
| docker exec -it core_cms /bin/bash | ||
| # That opens a command prompt within the container. | ||
| python manage.py collectstatic --no-input | ||
| docker exec -it core_cms sh -c "python manage.py collectstatic --no-input" |
There was a problem hiding this comment.
Just making this a one-liner, now that I know how.
| docker exec -it core_cms /bin/bash | ||
| # That opens a command prompt within the container. | ||
| npm run build:ui-demo | ||
| npm run build:ui-demo |
There was a problem hiding this comment.
THIS IS A FUNCTIONAL CHANGE! We cannot run npm inside container since #741.
There was a problem hiding this comment.
Similar updates and other improvements. See TACC/Core-CMS-Resources#196.
Overview / Changes
Related
Testing
I author from recent memory of repeat actions done often during development and testing.
UI
N/A