Feature Request: Add packaging and deployment hooks
- Dominant language
- Python
- Stars
- 11.1k
- Forks
- 1k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
# Feature Request: Add packaging and deployment hooks
Similar to other frameworks (eg: [serverless](https://github.com/serverless/serverless)) we should have the ability to modify the packaging and deployment process, to inject our own logic/code/etc with some packaging hooks and deployment hooks. The things that would be possible with this feature are as follows...
### Packaging hooks justifications & possibilities
* With a pre-packaging hook (or a "replacement" packaging hook instead of the current packager) it would allow us the possibility to alter how the packaging logic worked, eg: using a different packaging command/framework/script rather than `pip`
* With a post-packaging hook it would allow us to force-remove boto3/botocore dependencies that are auto-included in the package. This would **greatly** shrink our deployment zips.
* With a post-packaging hook it would allow us to break out of the current "forced" model of putting all our code in `chalicelib` folder. This would allow us to follow what is more typical and accepted as best-practice in our personal Python projects, and not be forced to use a chalice-specific folder-hierarchy scheme
### Deployment hooks justifications & possibilities
* Would allow us to run a pre-deployment hook to provision any assets on AWS necessary (SQS, DynamoDB, S3 buckets, etc). Currently, the "Chalice Workshop" codebases are all a bit messy and not-ideal for developers/engineers to deploy into AWS since you have to engineer and support a "create-resources.py" (or so) script which can create resources on AWS for you which the user HAS to run manually. This would also simplify some of your tutorials about how users can run `chalice package --merge-template extras.json out` to "merge" a template into the deployment zip which is really messy.
* Would allow us to run a pre or post-deployment hook to perform database migrations or modifications necessary. This would be useful for a more traditional RDMBS such as MySQL, PostgreSQL, etc
* Would allow us to automatically run a simple post-deploy hook to modify or update certain resources
* Would allow us to run a post-deploy API / integration test as part of chalice
Related to/Reference: #1335
Contributor guide
Research direction
Start by reviewing the existing chalice package and chalice deploy workflows, including the documented --merge-template path and the related issue #1335. Clarify the hook lifecycle, supported packaging and deployment stages, and how user-provided logic would be configured. Done should include an agreed scope and behavior for packaging and deployment hooks, including whether resource provisioning, migrations, and integration tests are supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- build-system, cloud, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100