As of 11/30/22, this repo no longer serves as the base image for the Texastribune website and CMS. For now, it is still in use for the salaries app.
Github's dependabot regularly creates PRs that bump package versions in order to fix known security issues. To ensure that these updates don't cause unexpected behavior on the Texas Tribune website, we prefer to test them locally before merging and deploying them.
Consult our dependabot testing guide for step-by-step instructions on testing and deploying.
The following instructions provide a general guide to updating, adding or removing Python and Node dependencies in this repo.
# bring down latest
git pull origin master
# create a feature branch for your changes
git checkout -b <new-branch-name>
If you're adding or updating a python dependency:
make base-shell
# from inside the container shell from step 1:
# add or upgrade a new production python dependency
poetry add <package>
# add/upgrade a new development dependency
poetry add --dev <package>
# pin the dependency to a specific version like this
poetry add <package>@1.0.0
exit
pyproject.toml manually, then run poetry lock in the shell inside the container.See the poetry docs for more commands and details on usage.
If you're adding or updating a node dependency:
make dev-shell
# from inside the container shell from step 1:
# enter the node directory
cd node
# add a new package
npm install --save <package-name> # use --save-dev if dev dependency
# add a specific version of a package
npm install --save <package>@1.0.0
# get help on npm for further usage
npm help
exit
Build new images locally based on your python or node dependency updates
# from your local machine's shell - not the container!
make images
This creates two local images:
texastribune/base:<git-branch-name>-devtexastribune/base:<git-branch-name>-baseYou can check that they were successfully created by runnning:
docker images | $(git branch --show-current)
# example output:
texastribune/base branchname-dev 2707ec0fcf6b 22 minutes ago 2.24GB
texastribune/base branchname-base 8a387eac996c 59 minutes ago 1.37GB
Test it locally
texastribune repo:
BASE_PRODUCTION_VERSION and BASE_DEVELOPMENT_VERSION variablestexastribune docs for they should be updated, or use your text editor search.texastribune PR.If all looks good, proceed to deploy steps.
If this is a small change that's very unlikely to affect anyone else, you'll build your new images directly through master, otherwise build your images through your feature branch.
tt-base branch.master and proceed to steps to deploy texastribune.make bump command and follow the prompts in order to bump the version and tag it. The final prompt will push the tag to remote. There should be as little gap as possible between this step and the previous one so as to avoid conflicts with other committers.tt-base branch.texastribune/base:<git-branch-name>texastribune PR to use these ^ images built from the tt-base feature branch. Anyone can pull that PR's branch down to test locally.texastribune PR is approved, merge your tt-base feature branch into master, and delete the feature branch.git checkout master and git pull to get your local master branch even with remote.make bump command and follow the prompts in order to bump the version and tag it. The final prompt will push the tag to remote. There should be as little gap as possible between this step and the previous one so as to avoid conflicts with other committers.texastribune PR to use the tag instead of the branch name (example: texastribune/base:1.2.14-base and texastribune/base:1.2.14-dev). See the texastribune README for the locations to change the version. You may want to wait until the Docker Hub build is complete before pushing your texastribune PR image version because the CI tests will fail if the image isn't available yet.texastribune PR. In an emergency you can leave in the branch name -- the image should
already be built by Docker Hub and it won't go away even when the branch is deleted.texastribune PR.Content type
Image
Digest
sha256:68a9f0aca…
Size
969.7 MB
Last updated
over 3 years ago
docker pull texastribune/base:dependabot_npm_and_yarn_node_json5-1.0.2-dev