For inspiration and motivation, see Keep a CHANGELOG.
django-simple-deploy uses a plugin model internally. There shouldn't be many external changes due to this model, but this is an important enough step towards a 1.0 release that it warrants a bump in the minor version number. The 0.8.0 release should indicate preliminary support for external plugins.
- All platform-specific tests moved to plugin directories.
- Integration and e2e tests use
uv
for setup work, when available as a system command. - Ran Black against the entire repository.
- Requires
pluggy
. - Fixes bug in validating authenticated Heroku CLI session.
- All platforms use a plugin model internally.
- Developer resources moved to platform-specific subdirs.
- All imports in plugins are relative to the plugin, rather than using simple_deploy paths.
- Simpler implemenation of
write_file_from_template()
utility function. PlatformDeployer
class moved to separate file for all plugins.- Core simple_deploy verifies that selected plugin implements required hooks.
- All plugins must implement
simple_deploy_automate_all_supported()
, which returns a boolean indicating whether the plugin supports the--automate-all
flag. If--automate-all
is supported, the plugin must also implementsimple_deploy_get_automate_all_msg()
, which provides a platform-specific message for confirming the usage of--automate-all
. - All plugins must implement
simple_deploy_deploy()
.
- All plugins must implement
- Platform.sh deployments work with project names including spaces and capital letters. These names are converted to lowercase with underscores during configuration.
- Platform.sh now works for users with multiple orgs, and multiple projects already deployed.
- Removed warnings about preliminary status of Fly.io and Platform.sh.
- Platform.sh deployments were broken. Fixed redundant, broken check for confirming automate_all.
- Move stale issues and tasks to Parking Lot.
- Consistent approach to managing settings and env vars across all platforms.
Many changes to update the project and work toward a plugin-based model. Most of this work is around simplifying workflows, and making them consistent across platforms.
- Fly deployment works for multiple deployments.
- Previously, Fly deployments would fail if you already had a project deployed to Fly, because it wasn't clear which resources to use for the current deployment.
- Now, if it's not obvious which resources to use, user is presented with a numbered list of resources so they can choose the appropriate one.
- Heroku configuration updated to match current process in Heroku docs.
- Use Heroku Postgres
essential-0
instead of deprecatedmini
. - Update database configuration, and static file configuration.
- Use Heroku Postgres
- Refactor deploy scripts for all three platforms.
- Restructure tests to make a clear distinction between unit, integration, and end-to-end tests.
- Use numbered choices to let user select appropriate remote resources when not obvious which one to use.
- More small utility functions, with better unit tests.
- More specific CLI calls for each platform, to make parsing output easier. For example, use
--json
flags whenever they're available. - Docstrings are more consistent.
- Started Coding Guide and Architecture Notes. Started documenting the contract between host and plugins.
- Core simple_deploy.py confirms
--automate-all
usage, using platform-specific confirmation message. - Simpler approach to managing settings. Write as a block, and get permission to overwrite if existing platform-specific settings block found in settings.py (Heroku).
- Sample project updated to use POST-based logout.
- Fixes some issues managing Fly and Platform.sh CLI usage on Ubuntu and macOS.
Deployments should work on all three platforms, for all major OSes. Any fixes from this point should be much more minor bugfixes, rather than rethinking the overall approach. This should be a transition to 1.0.
- Detects missing Heroku CLI on Ubuntu.
- Creates a Postgres databse on Heroku as needed.
- Updates roadmap.
- Starts to use
--json
on some Heroku CLI calls.
Stabilize deployments to Fly.io. Previously, deployment to Fly.io would fail if you already had an app deployed on Fly. This release addresses that issue, and significantly improves the process for deploying to Fly.
- Shows all the user's undeployed apps on Fly.io, and gets confirmation that the correct app to deploy to has been chosen.
- If a database is found with a name matching the selected app, gets confirmation that it's okay to use that database.
- Updates all messages related to Fly.io deployments.
- Updated readthedocs config file.
- Fly
deploy.py
file is longer, and needs some refactoring.
Improve logging to include all project inspection steps. This should help with development and troubleshooting.
- Logs all system and project inspection steps.
- Creates log file immediately, unless
--skip-logging
is used. Previously, a log file wasn't written until we were writing other changes to the project. - Implements
SimpleDeployCommandError
, which logs the error before raisingCommandError
.CommandError
should not be used, unless the error output contains sensitive information. - Implements
log_info()
method, which only logs information without writing it to the console.
Deployment to Platform.sh should be stable. Resumes preliminary support for Fly.io. Heroku deployment is probably broken for new users.
- Updates to documentation:
- Updated information in Choosing a Platform.
- Many smaller documentation improvements from multiple people looking closely at docs.
- Started official documenation for integration tests.
- Fly.io:
- Assumes you have no existing Fly apps.
- Identifies lowest-latency region to deploy to; defaults to 'sea' if that information is unattainable.
- Deprecate use of
flyctl
; usefly
consistently throughout.
- Heroku:
- Uses
'*'
forALLOWED_HOSTS
on Heroku, as a temp fix.
- Uses
- Added
.venv
to.gitignore
, so developers don't have to usedsd_env
. - Unit tests:
- No longer use shell scripts;
- Check for Poetry and Pipenv before running;
- No longer require any platform's CLI to be installed;
- Fixed
rum
mispelling ofrm
in unit tests using Poetry, which should improve accuracy of unit testing when using Poetry. - Pass on Windows as well as macOS and Linux.
- Add
simple_deploy
to Poetry and Pipenv requirements for fly configurations.
- Integration tests
- Converts most existing functionality in integration tests from shell scripts that only work on macOS/ Linux, to cross-platform functionality.
- Prints summary of functionality tests.
- Other changes
- Validates pytest call, to run either unit tests or integration tests, not both. Also require
-s
for integration tests. - New tool for standing up a dev environment:
build_dev_env.py
- Started less formal notes about each platform, in developer_resources/.
- On Fly deployments, updates
fly open
calls tofly apps open -a <app-name>
. Also updates deprecatedfly regions list -a
to get region with lowest latency.
- Validates pytest call, to run either unit tests or integration tests, not both. Also require
- Heroku deployments work again.
- Integration test runs
pip cache purge
before installing simple deploy when using-t pypi
flag.- This flag is often used immediately after making a new release, and this should ensure the new version is installed from PyPI.
- Calling
pytest
from project root generates a clean, simple reminder to cd tounit_tests/
first. - The version of
psycopg2
no longer needs to be pinned to<2.9
on Heroku deployments using requirements.txt.
- Clarified documentation about configuration-only mode. We do sometimes create remote resources on the user's behalf, but only when we can't easily ask users to do so before running
simple_deploy
. - All three platforms now support all three dependency management systems (bare
requirements.txt
file, Poetry, and Pipenv). - Updated documentation about unit tests.
- Official documentation includes a roadmap, with a focus on reaching a 1.0 release.
- Started platform-agnostic tests for the process of inspecting local projects.
- The check for whether Poetry is being used is more specific.
- Every unit test now runs once for each dependency management system.
- The dependency management system is identified in
simple_deploy.py
, but platform-specific scripts make all decisions about what to do with that information.- Better internal support for platforms to work with requirements. There's a simple
add_package()
method insimple_deploy.py
, as well asadd_packages()
. These then call the appropriate method for the current dependency management system in use. - Docker-based platforms make appropriate use of specific package managers, ie creating an optional
deploy
group inpyproject.toml
when Poetry is being used.
- Better internal support for platforms to work with requirements. There's a simple
- The output of
manage.py simple_deploy --help
is significantly improved. - CLI-related error messages have been improved.
- The CLI is thoroughly documented on RtD.
- Moved all platform-specific files to their own directory. The only reference to a specific platform in simple_deploy.py is now the validation of the platform name.
- Simplified setup.cfg to only refer to the
simple_deploy
package. - Simplified use of the Django template engine to write and modify files for configuration; see
write_file_from_template()
in utils.py. - Platform-specific imports are now done dynamically in simple_deploy.py, so only the files for the targeted platform are actually imported.
- Simplified setup.cfg to only refer to the
- Implementation of the CLI has been improved:
- All CLI args are now defined in a separate module,
cli.py
. - Help output is covered in a unit test.
- All CLI args are now defined in a separate module,
- Other developer-focused documentation improvements:
- Documented maintenance of docs.
- Started ADR documentation.
- Added Black to requirements, and used it to format the new
cli.py
file.
- Removes local dependence on
platformshconfig
. Usesos.environ.get()
locally to check whether deployment-specific settings should be used.
- Fixed validation of
--platform
argument when used with--automate-all
.
- Removed
execute_subp_run_parts()
, and usingshlex.split(cmd)
instead ofcmd.split()
.
- Streams output of
platform create
when deploying to Platform.sh using--automate-all
. This makes it more clear that the deployment has not hung on thecreate
step.
- When configuring for Fly.io deployments, uses whitenoise to serve static files. Runs collectstatic during the build process.
- Updated unit test suite.
- Unit test runs add
simple_deploy
toINSTALLED_APPS
after last commit, like most end users would. - Unit tests are reorganized to separate tests for each platform, and to have a dedicated set of platform-agnostic tests.
- Most shell scripts have been moved to a
utils/
directory. - A much simpler approach to testing invalid CLI calls is used.
- Includes a basic set of unit tests for Fly.io configuration .
- Each
unit_tests/platforms/
dir contains areference_files
directory. When unit tests run, modified sample project files are compared to these reference files. This makes it much easier to reason about unit tests, and provides a nice set of files to see exactly what changessimple_deploy
makes to the sample project's files. - The sample project is only built once for every test session, rather than once per test module. The test project is reset for each new test module. This results in a speedup from ~52s to ~16s for the entire suite at this point. More importantly, testing more platforms and dependency management approaches will only incrementally increase test duration, rather than multiplying test duration.
- Official documentation covers how to run unit tests. This update also includes some minor but important updates to the unit tests. These updates center around a better use of
autouse=True
where appropriate, and better use and explanation of scope. - In unit tests, we make sure the main branch is named
main
. Some tests expect to see references to themain
branch in CLI output, and this would have failed on any contributor or CI system with a different default branch name.
- Unit test runs add
- Configuration works when the target project's
settings.BASE_DIR
is a string. This affects any project whose setting file was generated in Django 3.0 or earlier, and hasn't been updated to usePath
objects. - When configuring for Heroku deployments, Whitenoise is added to middleware. This fixes a bug where the admin site on Heroku deployments does not have access to static resources such as css and js.
- Started the Contributing section on the official documentation:
- Main contributing page
- Documenting a Test Run
- Testing on Your Own Account
- Setting up a Development Environment
- Added issue template for documenting test runs.
- Deployments on Platform.sh no longer include a
.platform/routes.yaml
file.
- Documentation for managing PRs and releases moved to Read the Docs.
- Documentation includes installing
platformshconfig
when deploying to Platform.sh. - Removes auto-update block from
.platform.app.yaml
. - Integration tests check that running simple_deploy does not affect local functionality using
runserver
.- Update configuration for Fly.io and Platform.sh to not interfere with local functionality using
runserver
.
- Update configuration for Fly.io and Platform.sh to not interfere with local functionality using
- Updated sample blog project to Django 4.1.2.
- Modified
test_deployed_app_functionality.py
to not require a trailing forward slash. - Added notes about the differences between nested and non-nested projects.
- Modified
- Deployments to Fly.io use the deployed project name in
ALLOWED_HOSTS
andCSRF_TRUSTED_ORIGINS
settings.
- Streams output of
platform push
.
- Streams output of long-running commands
fly postgres create
andfly deploy
. This makes it much easier to know that the deployment is continuing, rather than hanging.
- Generates a
.dockerignore
file when deploying to Fly.io.
- Uses updated Dockerfile from Fly.io.
- The
-y
flag skips confirmation for teardown when running integration tests.
- Official documentation moved to Read the Docs.
- Quick-start guides for all three supported platforms.
- Better check of
git status
when runningsimple_deploy
. If the only uncommitted change is addingsimple_deploy
toINSTALLED_APPS
, no error is raised.
- Preliminary support for Fly.io
- Configuration-only and
--automate-all
approaches work on my macOS. - Probably only works when you don't have any other Fly.io projects deployed.
- No documentation for Fly.io yet.
- No unit tests yet.
- Integration tests work.
- Configuration-only and
- Refining support of Platform.sh:
- Initial unit tests for Platform.sh.
- Initial integration tests written for Platform.sh.
DEBUG = False
by default on Platform.sh.- Check that
platform create
has been run, or that a deployed project name has been provided. - More informative error messages if any prerequisite conditions are not met, such as running
platform create
. --automate-all
now works on Platform.sh.- Improved success messages after configuration-only run.
- Significant restructuring of simple_deploy's architecture, to more cleanly separate platform-agnostic work from platform-specific work. For example, see Issue 89.
- More integrity checks before making any configuration changes:
- Check
git status
before beginning configuration work. Warn users and exit if status is notworking tree clean
. The--ignore-unclean-git
flag will override this warning. - Check that Platform.sh CLI or Heroku CLI are installed before configuring for those platforms.
- Check
- Developer-focused improvements:
- Added a
-y
flag to integration test script, to skip bash script confirmations. - Separated
--local-test
flag into--unit-testing
and--integration-testing
flags.
- Added a
- Requires
--platform
flag.- There's no reason to have a default platform; deployment is a significant enough step that users should have a specific deployment target in mind. If the
--platform
flag is omitted, exit with a message displaying a list of platforms that are supported.
- There's no reason to have a default platform; deployment is a significant enough step that users should have a specific deployment target in mind. If the
- Simplified MANIFEST.in
- No user-facing changes, but built release to verify that changes don't break the release process.
- Removed support for Azure.
- See detailed rationale in Stop supporting Azure.
- Brief rationale: Focus django-simple-deploy on platforms like Heroku and Platform.sh where everything is contained in a single project, rather than a collection of services.
- May resume support at some point in the future, but the project needs to evolve further before resuming this support.
- Azure was used as a proof-of-concept to try supporting multiple platforms. Since then, I have had time to explore other platforms that are more suitable targets for django-simple-deploy.
- Preliminary support for platform.sh
- If you have a platform.sh account, have installed the CLI, are using Git,
and have a
requirements.txt
file, running$ python manage.py simple_deploy --platform platform_sh
should configure your project for deployment on Platform.sh. - Then you'll need to commit changes, run
platform create
, andplatform push
. - Project should open with
platform url
.
- If you have a platform.sh account, have installed the CLI, are using Git,
and have a
- Fix image loading issue in main README on PyPI.
- Set up local unit testing (testing with no network calls).
- Moved all testing documentation to old_docs/.
- Simplified approach to the
ALLOWED_HOSTS
setting for Heroku deployments.- If the Heroku host is not found, append the Heroku host to
ALLOWED_HOSTS
in the Heroku-specific settings section, regardless of what else is inALLOWED_HOSTS
. This is motivated by reports from users who have followed tutorials that advise them to modifyALLOWED_HOSTS
in a variety of ways. Appending our host in a Heroku-specific settings section should not cause any foreseeable problems. - Also improved unit testing. Tests can be run against multiple versions of the sample project, by modifying the project after it's created. This does not add significantly to test runtimes.
- If the Heroku host is not found, append the Heroku host to
- Added documentation of full set of CLI arguments.
- Progress towards supporting projects with a nested directory structure.
- This is for projects started with
django-admin startproject project_name
, without a dot. - Includes nested version of sample blog project.
- This is for projects started with
- Fixes bug on Windows, where system commands were not running.
- Steadily improving internal structure.
- Writes verbose log file; adds log directory to .gitignore.
- Simplified the integration testing scripts significantly.
- Added brief roadmap.
- Added brief contributing guide.
- Added a Code of Conduct.
- SECRET_KEY on Heroku uses a config variable.
- DEBUG on Heroku uses a config variable.
- Preliminary support for Azure deployments.
- Supports Python 3.8, because Azure is still on 3.8.
- Bugfix to address import error in deploy_heroku.py.
- Bugfix: Minor bugs were causing issues with final message after deployment process had been completed.
-
External changes:
simple_deploy
accepts a--platform
argument. The default, and only meaningful value at the moment isheroku
. However, this change makes it possible to begin targeting other platforms.
-
Internal changes:
- Testing script is broken into platform-agnostic, and Heroku-specific files.
- Test script accepts a platform argument:
$ autoconfigure_deploy_test.sh -o automate_all -p heroku
. Heroku is default value, and is the only meaningful value at the moment.
- Internal changes:
- All multiline output messages defined in a separate module.
- Reviewed all existing comments. (11/5/21)
- Refactored code that adds Heroku-specific settings.
- Includes
--automate-all
flag.
- Supports projects that use Poetry.
- Supports projects that use Pipenv.
- Makes Heroku install from PyPI instead of the GitHub repo.
- Added change log.
- Expanded main README to include detailed steps, and more.
- Fixed markdown formatting issue on PyPI.
- Initial functionality; works for my project.