Test CMS Changes - TACC/Core-CMS GitHub Wiki
- Deploy branch on available development server for the relevant project.
- Have an existing Core-CMS.
- (If docker containers are running) Stop (i.e. bring
down) the docker containers. - Checkout branch to test.
- Run command
npm run build. - Start (i.e. bring
up) the docker containers.
-
Have an existing Core-CMS.
-
(If docker containers are running) Stop (i.e. bring
down) the docker containers. -
Ensure CMS secrets are up to date and accurate.
-
Checkout relevant branch.¹
-
Delete local CMS
staticdirectory and all localbuilddirectories.²Steps
From repo root:
rm -rf staticrm -rf taccsite_cms/static/**/buildrm -rf taccsite_custom/*/static/**/build
-
In the relevant
docker-composeconfig file, update theservices:cms:imagevalue to a provided docker image tag. -
Rebuild the
cmsdocker container without cache.Steps
-
docker-compose build --no-cache cms(beware of-f)³ -
docker-compose up --force-recreate --no-deps -d cms(beware of-f)³
-
-
Start (i.e. bring
up) the docker containers. -
(If error contacting database) Stop (i.e. bring
down) then Restart (i.e. bringup) the docker containers.⁴ -
In the CMS container, run
python manage.py collectstatic --no-input.
⚠️ Warning: These steps have not been thoroughly verified.
-
Have an existing Core-Portal.
-
(If docker containers are running) Stop (i.e. bring
down) the dockers. -
Checkout relevant branch.⁵
-
Ensure CMS secrets are up to date and accurate.
-
Delete local CMS
staticdirectory.²Steps
From repo root:
rm -rf server/cms/static
-
In the relevant
docker-composeconfig file, update theservices:cms:imagevalue to a provided docker image tag. -
Rebuild the
cmsdocker container without cache.Steps
docker-compose -f server/conf/docker/docker-compose-dev.all.debug.yml up --force-recreate --no-deps -d cms -
Start (i.e. bring
up) the docker containers. -
(If error contacting database) Stop (i.e. bring
down) then Restart (i.e. bringup) the docker containers.⁴ -
In the CMS container, run
python manage.py collectstatic --no-input.
Footnotes
-
Which branch?
-
For testing changes to any files except
secrets.py, checkoutmainas a precaution to avoid an inaccurate test.The files to test should come from the image, not your local machine. If you have locally checked out
main, and any files in the docker are unintentionally synced from your local environment to the docker, then they are the wrong files, thus more likely to cause a test failure. -
For testing changes to
secrets.py, checkout relevant branch and editvolumesin relevantdocker-composefiles to sync thesecrets.pyfile:- ${PWD}/taccsite_cms/secrets.py:/code/taccsite_cms/secrets.py
-
-
Why delete? To be sure that any static files in the CMS docker container originate from the image and were not synced from your local environment.
-
If you intend to test a remote image without local modification, then do not use
-f docker-compose.dev.yml(nordocker-compose.custom.ymlbased ondocker-compose.dev.yml), because the- .:/codeentry forvolumeswill overwrite the containers files originating from the image. -
The first start may hit a database contact error,
Name or service not known. The second start should not. -
So that the CMS test is against the correct Portal code:
- If the CMS branch has an accompanying Portal branch, then checkout that accompanying Portal branch.
-
If the CMS branch does not have an accompanying Portal branch, then checkout
main.
Advanced. See Locally Develop CMS + Portal + Docs.