Helps generating artifacts for Drupal by wrapping all code into an artifact, and pushing it to the artifact remote repository.
composer require metadrop/drupal-artifact-builder
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:
cp vendor/metadrop/drupal-artifact-builder/.drupal-artifact-builder.yml.dist .drupal-artifact-builder.yml
-
repository: Repository URL (git SSH / git HTTP URL).
Example:
repository: [email protected]:example/example-artifact.git
-
include: Extra files or folders to include into the artifact.
Example:
include: - oauth - solr
-
author: It will be the author used in git commits.
Example:
author: John Doe <[email protected]>
-
branches_map: Key value map to git push source artifact branches to different artifact branches.
Example:
branches_map: develop:develop-build
This example will make push the artifacts coming from develop source branch to the develop-build artifact branch.
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:
drupal-artifact-builder
Generate the artifact:
drupal-artifact-builder create
Push the created artifact to git:
drupal-artifact-builder git
-
config: Allow setting the configuration file. Defaults to .drupal-artifact-builder.yml
drupal-artifact-builder git folder/.drupal-artifact-builder.custom.yml
-
repository: Selects the repository where the artifacts will be pushed.
Examples:
For the complete command (create + git):
drupal-artifact-builder --repository [email protected]:example/example.git
For the git command:
drupal-artifact-builder git --repository [email protected]:example/example.git
-
include: Allow adding more paths to the artifact.
drupal-artifact-builder --repository [email protected]:example/example.git --include=oauth.json,mycustomapp
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:
cp vendor/metadrop/drupal-artifact-builder/.drupal-artifact-builder.yml.dist .drupal-artifact-builder.yml
-
Change --extra-paths parameters to --include
Before:
drupal-artifact-builder --extra-paths solr
Now:
drupal-artifact-builder --include solr
-
Stop using GIT_BRANCH environment variable, not it is --branch
Before:
GIT_BRANCH=develop drupal-artifact-builder
Now:
drupal-artifact-builder --branch develop