Scaffolding is default implementations of the build phases and runtime hooks for your application. They also provide some default health check hooks where appropriate to ensure your application is functioning reliably. Customized Scaffolding can be created to facilitate re-usability of common patterns in your organization for developing, building, and running your applications.
New Projects (Coming Soon!)
hab plan init to leverage the scaffolding. Habitat will look in your application code for known project types and add the appropriate scaffolding.
If you would like to specify the desired scaffolding to use, you can run
hab plan init --scaffolding core/java8-maven-tomcat
The resulting plan will contain all the available callbacks and variables relevant to the scaffolding type.
To begin using Scaffolding, you will need to add the appropriate
``` pkg_name="my_java_app" pkg_scaffolding="core/scaffolding-java8-maven-tomcat" ```
Embedded Plans (Coming Soon!)
Each scaffolding defines a default value for
pkg_source in URI syntax. You can override this value within your plan should you application source live in a non-standard location.
Each scaffolding defines a set of callbacks which are unique to the scaffolding type. Please see the documentation for the appropriate scaffolding for details on each scaffolding's callbacks. Depending on the language, some default callbacks are defined as overrides since they are are often not used for building packages in that language.
The default_begin phase is executed prior to loading the scaffolding. This internal callback allow the scaffolding to run anything we need to execute before the download and build.
These are variables which each scaffolding honors, allowing the plan author to consume the value to override a particular behavior. Please see the documentation for the appropriate scaffolding for details on each scaffolding's callbacks.
Run Hooks (Coming Soon!)
Each scaffolding comes with a default health check for your application.
Each scaffolding defines it's own
pkg_deps arrays with any required packages and is merged into the TDEPS (transitive dependencies) as it would any other package.
To create scaffolding, a package must contain a
lib/scaffolding.sh bash script. If the file exists, and a plan contains a valid
pkg_scaffolding variable it will be sourced into the plan-build.