Download the PHP package metadrop/drupal-artifact-builder without Composer
On this page you can find all versions of the php package metadrop/drupal-artifact-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package drupal-artifact-builder
Drupal artifact builder
Helps generating artifacts for Drupal by wrapping all code into an artifact, and pushing it to the artifact remote repository.
Table of contents
- Installation
- Usage
- CI integration
- Upgrade from 1.x to 2.x
- Upgrade from 2.x to 3.x
Installation
Configuration
Drupal artifact builder allow using a configuration file to create the artifact. Artifacts usually are executed using always the same parameters. So, a configuration file saves time adding those parameters every time the command is run.
Configuration file is placed at root (it can be changed through command line parameters). You cam copy the template to have an starting point:
Configuration properties
-
commands: Commands to run inside the artifact folder before packaging.
Example:
-
repository: Repository URL (git SSH / git HTTP URL).
Example:
-
include: Extra files or folders to include into the artifact.
Example:
-
author: It will be the author used in git commits.
Example:
-
branches_map: Key value map to git push source artifact branches to different artifact branches.
Example:
This example will make push the artifacts coming from develop source branch to the develop-build artifact branch.
Usage
Important: Please note that Drupal Artifact Builder does not download Composer libraries or compile CSS assets. These tasks must be completed prior to running the command.
Builds the artifact and push the changes to git:
Generate the artifact:
Push the created artifact to git:
Parameters
-
branch: Branch to create the artifact from / to. Required.
-
config: Allow setting the configuration file. Defaults to .drupal-artifact-builder.yml
-
repository: Selects the repository where the artifacts will be pushed.
Examples:
For the complete command (create + git):
For the git command:
- include: Allow adding more paths to the artifact.
CI integration
GitHub Actions
A ready-to-use workflow is available at examples/github-actions.yml. Copy it into your Drupal project at .github/workflows/deploy-artifact.yml and follow these steps:
-
Generate an SSH key pair for the artifact repository:
-
Add the public key (
artifact_deploy_key.pub) as a deploy key with write access in the artifact repository settings (Settings > Deploy keys). -
Add the private key (
artifact_deploy_key) as a repository secret namedARTIFACT_DEPLOY_KEYin the source Drupal repository (Settings > Secrets and variables > Actions). - Adjust the workflow to your needs:
- Update the
brancheslist underon.pushto match the branches you want to deploy. - Change the Docker image tag (
php8.3-node20) to match your PHP and Node versions. Available tags are listed in the drupal-artifact-builder-docker repository.
- Update the
Prerequisites: Before running the workflow, make sure .drupal-artifact-builder.yml is correctly configured in your project root as described in the Configuration section. At minimum, the repository key must point to the artifact repository.
The workflow runs inside the ghcr.io/metadrop/drupal-artifact-builder-docker image, which provides PHP, Composer, Node, and Git out of the box. You can replace this image with any other, as long as it includes PHP, Composer, and Git.
Upgrade from 1.x to 2.x
2.0.0 release brings breaking changes and the way to use drupal-artifact-builder changes.
These steps must be followed in order to upgrade to the 2.0.0 version:
-
Copy and configure .drupal-artifact-builder.yml:
-
Change --extra-paths parameters to --include
Before:
Now:
-
Stop using GIT_BRANCH environment variable, now it is --branch
Before:
Now:
Upgrade from 2.x to 3.x
To be able to bring composer libraries and compile the custom theme, configure commands in .drupal-artifact-builder.yml.
Example: