Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker development environment improvements #180

Merged
merged 6 commits into from
Mar 24, 2021
Merged

Conversation

glennmatthews
Copy link
Contributor

Fixes: #163 (in a roundabout way)

  • Remove the "↩️ Skip creating the superuser" message from docker-entrypoint.sh (which is extraneous at best, and downright confusing when running invoke createsuperuser)
  • Adjust logging configuration in the development environment so that it isn't verbose when running unit tests (which otherwise results in a lot of noise)
  • Remove --python-ver argument from all invoke tasks and document in the developer guide that export PYTHON_VER=3.x is the way to set a non-default Python version for the Docker Compose workflow.
  • Add docker_compose() helper function in tasks.py and use it to cut down boilerplate.
  • Add --nocache and --forcerm options to the build task.
  • Add invoke restart task.
  • Rename coverage-run and coverage-report tasks to unittest and unittest-coverage respectively.
  • Add --keepdb option to the unittest task
  • Bypass docker-entrypoint.sh when running unit tests and linters (saving container startup time).

Copy link
Contributor

@jathanism jathanism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love this overall. I would like to see the tasks that have flags be documented using the help argument to the @task() decorator and remove the extra context and flag documentation from the docstrings.

tasks.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jathanism jathanism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 🇮🇹

@task(
help={
"force_rm": "Always remove intermediate containers",
"cache": "Whether to use Docker's cache when building the image (defaults to enabled)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh fancy.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

% invoke build --help
Usage: inv[oke] [--core-opts] build [--options] [other tasks here ...]

Docstring:
  Build Nautobot docker image.

Options:
  -c, --[no-]cache   Whether to use Docker's cache when building the image (defaults to enabled)
  -f, --force-rm     Always remove intermediate containers

🤵

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add --python-ver parameter detection for invoke command
2 participants