Defining build and deployment configuration for a set of source files.
package.ocu.star
.
When a package file is placed in a directory, Ocuroot will automatically monitor the files in
that directory and its subdirectories for changes. When a file is changed, Ocuroot will execute
builds and subsequent deployments as needed to release the changes.
package
function is used to define each
individual package.
As an example, the below package file will define a single package named my_package
:
build
- defines the build logic for the packagedeploy
- defines the deployment logic for the packagepolicy
- defines the deployment policy for the packagepolicy
function can be thought of as the “glue” between the build
and deploy
functions.
This function is executed against every environment after any build or deployment that affects this
package.
If the policy
function returns later()
, this indicates that the build has not yet met the
criteria for deployment to this environment. In this example above, this is returned for the
production environment if the package has not yet been deployed to staging.
If the policy
function returns ready()
, then the package will be deployed to
the environment.
If the policy
function returns skip()
, then the package will not be deployed to this environment.
If a previous build of this package is already deployed to this environment, it will be destroyed.