-
Notifications
You must be signed in to change notification settings - Fork 1
Test CMS Changes
- 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
static
directory and all localbuild
directories.²Steps
From repo root:
rm -rf static
rm -rf taccsite_cms/static/**/build
rm -rf taccsite_custom/*/static/**/build
-
In the relevant
docker-compose
config file, update theservices
:cms
:image
value to a provided docker image tag. -
Rebuild the
cms
docker 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
static
directory.²Steps
From repo root:
rm -rf server/cms/static
-
In the relevant
docker-compose
config file, update theservices
:cms
:image
value to a provided docker image tag. -
Rebuild the
cms
docker 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
, checkoutmain
as 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 editvolumes
in relevantdocker-compose
files to sync thesecrets.py
file:- ${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.yml
based ondocker-compose.dev.yml
), because the- .:/code
entry forvolumes
will 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.
TACC ACI WMA Core-CMS Project Documentation