Creating artifacts¶
Introduction¶
To successfully use the Artifact deployment method, your project must create package releases containing artifacts ready for deployment. This guide explains how to set up your project for this purpose.
Setting up your .gitlab-ci.yml
file¶
The Dropsolid Experience Cloud uses GitLab to host projects and checks for
any dxp-
prefixed packages that contain files to expose as
options in the 'Deploy' shortcut popup. When a
package contains duplicate assets, only the last asset is shown to deploy.
These packages are created using GitLab pipelines, which require a correctly
configured .gitlab-ci.yml
file.
While there are no strict requirements for the package or compressed artifact file, the file must be
a generic package and should either be a .zip
or .gz
format.
However, we provide default configurations in our component library to simplify and expedite the process of creating a pipeline compatible with the Artifact deployment method.
Example .gitlab-ci.yml
¶
Below is a minimal example for a PHP project that uses composer
to manage dependencies (e.g., Drupal, Mautic). In this
setup, the project does not commit vendor dependencies to the repository; instead, it builds them during the build
stage. The artifact stages then compress all necessary files into an release.tar.gz
file and push it to the package
registry for deployment.
stages:
- build
- build-artifact
- push-artifact
include:
# Includes a component that runs `composer install` in the
# `build` stage with dev and production dependencies.
# If your project does not require external dependencies (e.g., HTML),
# you can skip or modify this step.
# If your project uses a specialized build method, it is advised to not include
# the provided component, but provide a custom one.
- component: $CI_SERVER_FQDN/resources/dxp-ci-catalog/composer-build@1
inputs:
php_version: '8.2'
# Includes a component to build the artifact.
- component: $CI_SERVER_FQDN/resources/dxp-ci-catalog/create-artifact@1
# Includes a component to push the artifact to the package registry.
- component: $CI_SERVER_FQDN/resources/dxp-ci-catalog/publish-artifact@1
# Ensures the artifact release build job depends on the composer build job
# or any other job you use to gather all external content for a release
# package.
create-artifact:build:
dependencies:
- composer-build:composer-install-prod
Package naming conventions¶
A package is created per branch, and one package for the tagged commits. For branch packages, the latest version will be overridden with a new package. For packages generated from a tagged commit a new version is created for each tag.