Code Assembly is a feature of Cloud Platform that manages the dependencies of Drupal and Node.js applications. In addition, it builds one or more necessary hosting artifacts and deploys them in a hosting environment. Customers can build, manage, and update the project code through Composer or Node Package Manager (NPM) to:
Significantly reduce the footprint of their Git repositories
Simplify the hands-on tasks required for maintenance and development
Code Assembly is a free tool that minimally adds dependency management support to the Acquia platform. It is not a complete CI/CD solution. You can neither customize the build or tests nor override its default behaviors. Therefore, Acquia recommends you to use a complete CI/CD solution such as Code Studio. If you plan to use a complete CI/CD solution, do not use Code Assembly along with that solution.
Features
The following are the features of Code Assembly:
- Automated installation of Composer dependencies specified in the
composer.json
andcomposer.lock
files - Ability to build artifacts that can be deployed to an environment
Requirements
The following are the requirements for using Code Assembly:
- Cloud Next environment
For Drupal: Composer-managed application running a supported Drupal version installed on the Cloud Next environment
Note
Adopt Composer as a dependency manager, and use a Composer scaffold such as Acquia’s Drupal recommended project.
For more information, visit Using Composer with local sites.
- Do not commit Composer-managed dependencies, such as the
vendor
directory, to your repository. - Update your
.gitignore
file to add rules to exclude Composer-managed files and directories, such asvendor
,docroot/core
, ordocroot/contrib
.
For Node JS: NPM-managed JavaScript-based application using Next Generation Node as a static site or a serverless Node.js application
Important considerations
If you are already using a CI/CD tool to build and deploy hosting artifacts, do not use Code Assembly.
Some of the examples of CI/CD tools are Code Studio, Pipelines, and GitHub Actions. These tools install dependencies, build hosting artifacts, and perform other development and DevOps tasks such as automated testing, security scanning, and code quality checks. Code Assembly is intended for customers who do not use a CI/CD tool for their Cloud Platform application.
Deploy branches to non-production environments before deploying them to production environments.
After deploying a branch to a non-production environment, you can use the Cloud Platform user interface to drag and drop the code to the production environment. This creates a tag from the most recent commit. For more information, visit Moving code from one environment to another.
- Use Cloud Actions to automate common Drupal tasks in environments during deployments.
Terminology
The following are the frequently used terms related to Code Assembly:
- Artifact: A hosting artifact includes all installed and sanitized dependencies that are necessary to host and use a Drupal application.
- Environment: A Cloud Next environment where you deploy code. For example, dev, stage, or prod.
- Scaffolding: A composer scaffold is a project template that includes:
- The composer.json and .lock files
- The appropriate .gitignore rules for the repository
- Locations defined in the composer.json file for managed dependencies
Limitations
The following are the limitations of Code Assembly:
- Code Assembly can be enabled only for Cloud Next applications.
- Code Assembly supports only public repositories.
- Code Assembly can currently build artifacts only for public repositories and not for private repositories.
- For PHP applications, Code Assembly uses 128 MB PHP memory to build code. This value cannot be changed in the current version.
- Code Assembly does not support custom configurations through the user interface.
- Code Assembly fails if the
composer.json
file is missing from PHP applications and thepackage.json
file is missing from Node.js applications. - For Node.js applications, Code Assembly reads configurations from the
package.json
file present in the source directory of your Git repository. It reads the values ofnode_version
,install_command
androot_directory
. - For Drupal applications, Code Assembly reads configurations from the
composer.json
file present in the source directory of your Git repository. It reads the value ofphp_version
.
- Code Assembly fails if the
- For SSG applications, the artifact size of the static site is limited to 10 GB. If the artifact size exceeds 10 GB, Code Assembly causes the build process to fail.
- For Drupal applications, Code Assembly supports Composer as the package manager.
- For Node.js applications, Code Assembly supports npm as the package manager.
- Code Assembly causes the build process to fail if artifacts are already present in the source directory of your Git repository.