This video comes from The Joy of Automating series, hosted by Franklin Webber.
In this episode we focused on converting the installation of Django into tested recipes. We explored installing Django from multiple sources: packages, pip, and through virtualenv. Which lead us into writing integration tests and unit tests for the various recipes, defining multiple test kitchen suites, and git branch workflow. Near the end we started to define a custom resource within the cookbook to handle our requests to install packages through pip.
In this episode we focus on taking the manual installation instructions found in this tutorial and create a recipe that does the work for us.
The completed exercise can be found here: https://github.com/chef-training/django
When you are done with the initial implementation we encourage you to challenge yourself by:
We walked through several installations. As an exercise walk through the final installation of installing Django through git. You will need the git resource.
We started to write the custom resource:
pip. Finish it.
- Replace the hard-coded installation of Django with a property
- Set that
true for the property so it defaults to using the name of the resource
- Set the install action as the default action
Installing Django through git uses a specific pip flag. Provide support for it by:
- Defining a new attribute to specify a source location
- Within pip's install action choose whether to include that flag if the source attribute contains a value