Code builders

NOTE: this feature is currently being rolled out on Silverstripe Cloud Public Sector and only some stacks will have it available.


A Code builder is a Docker image used by Silverstripe Cloud to transform your codebase into a production-ready build during deployments. The primary action these builders take on Silverstripe CMS projects is installing Composer dependencies, but in the future they may also support custom scripts to perform other tasks like building front-end dependencies.

Selecting a Code builder

You can select which builder to use on a per-Environment basis. This can be helpful when migrating between builders, as you can test the new builder in a UAT environment while still using your original builder in Production deployments.
To see which Code builder your environment is currently using or to change it, open the Code builders tab in the Environment view.

Pinned Environments

In some cases, your Environments may be pinned to a specific Docker image by the Silverstripe Cloud operations team, which will prevent you from selecting a Code builder until the pin is removed. Contact the Service Desk for more information.

Available Code builders

Legacy

Outdated builder which will be deprecated at a future date. It's not using selectable docker images, and no new features will be available on it.
There is no Docker image for this builder.

1.3.4 - Composer v1

This builder is backwards compatible with "Legacy" and provides Composer v1. Note Composer scripts and NPM builds are currently disabled on this builder.
The Docker image for this builder is silverstripe/platform-build:1.3.4.

2.0.3 - Composer v2

This builder is not backwards compatible and provides Composer v2. We recommend testing on UAT or test environments before deploying to production due the following incompatibilities:

  • Composer v2 has some edge-case issues with composer.lock files generated by Composer v1
  • Support for "private": "true" repositories has been removed (use explicit "[email protected]" reference instead)

Note Composer scripts and NPM builds are currently disabled on this builder.

The Docker image for this builder is silverstripe/platform-build:2.0.3.

Debugging

Before adopting a new Code builder, or if you encounter issues during deployments related to it, you can run the builder from your development environment in order to test its behaviour against your project. You will need Docker installed.
In a terminal window, run the following command from the project folder to trigger the builder (ensuring you set the correct Docker image version based on the Code builder you are using):

docker run \
--interactive \
--tty \
--volume composer_cache:/tmp/cache \
--volume ~/.ssh/id_rsa:/root/.ssh/id_rsa:ro \
--volume $PWD:/app \
--env CLOUD_BUILD_DISABLED=1 \
--env PARSE_COMPOSER=1 \
silverstripe/platform-build:1.3.2

Was this answer helpful? Yes No

Sorry we couldn't be helpful. Help us improve this article with your feedback.