34
loading...
This website collects cookies to deliver better user experience
make
and other derivatives can help you.build:
# Put here the commands to compile, install dependencies, build docker images...
make build
clean:
# Clean docker images, dist files, etc...
make clean
docker-compose up
, executing the main script, etc.), it could prepare the environment to ensure that the project starts up successfully: invalidating caches, creating an AWS session, running database migrations, etc...make init
to spin up the web server for theirs to run their HTTP requests. run:
# Run your project here
stop:
# In the same sense that there is a run, it might be interesting for you to have a stop command that kills the process/es that starts up the `run` command.
make run
make stop
setup-dev:
# Run pre-commit scripts, install dependencies locally...
make setup-dev
factory settings
(destroying and creating the local database, re-running the initial data migrations, etc.)reset: down
# Run db scripts to purge the DB/s, remove docker volumes...
make reset
# Example with postgres, leveraging docker
freeze: down
docker run -v my_postgres_vol:/volume -v /tmp:/backup --rm loomchild/volume-backup backup postgres
unfreeze: down
docker run -v my_postgres_vol:/volume -v /tmp:/backup --rm loomchild/volume-backup restore postgres
make freeze
make unfreeze
update-remote:
# call here the commands that are intended to be called when you deploy to your remote environment: Database migrations, cache invalidations, scripts to fix something...
make update-remote
generate-docs:
# call your doc generation tool (doxygen, sphynx...)
make generate-docs
run-command:
# e.g. python src/manage.py ($cmd)
make run-command cmd="XXXXX"
init
and up
. As the name implies, it applies the migrations to the database.migrate:
# Run here the command to execute the migrations
make check
check:
# Example leveraging pre-commit
pre-commit run --all-files
make check
patch
argument, and each time I deploy to production I manually call it with the minor|major
argument depending on the type of code change I'm conducting.bump-patch:
# Example with bump2version
poetry run bump2version $(LEVEL)
git add _version.py
git add .bumpversion.cfg
make bump-patch LEVEL=patch
run-tests:
# Call here the command to execute your tests: py.test, NUnit... just make sure that the environment variables needed by your tests are loaded. This is why I like to run my tests with docker compose!
make run-tests
snakeviz
or pyprof2calltree
. This command will open the latest report generated, ready for visualization.open-profiling:
# Example of command, adjust to your preferred visual tool
pyprof2calltree -i profiling/results/$(FILE).prof -k
make open-profiling FILE=results