Loading...

Customizing a default Code Studio pipeline

Using a custom .gitlab-ci.yml file

To use a custom .gitlab-ci.yml file to customize a default Code Studio pipeline, change the CI/CD configuration file path of the project:

  1. Click Settings > CI/CD.
  2. In the General pipelines section, click Expand and then enter the path to the custom .gitlab-ci.yml file.
  3. Click Save changes.

Customizing jobs

For any default job run by Code Studio Auto DevOps, you can:

Building front-end dependencies

A common use case for customizing a job is to build front-end dependencies. Front-end dependencies include final front-end asset files, such as minified .css and .js files. You can build front-end dependencies it in many ways. A quick way to build front-end dependencies is to add post-install-cmd to your project’s composer.json file. The post-install-cmd must contain the commands that must be executed to build your front-end dependencies.

For example, in composer.json:

"post-install-cmd": [
 "cd docroot/themes/custom/<my_theme> && rm -rf node_modules && npm install && npm run build"
]                                        

Ensure that you add the path to your custom theme in the installer-paths key of the composer.json file. For an example, see drupal-recommended-project.

Changing the Node.js version

For information about changing the Node.js version of your Drupal or Node.js application, visit Changing the Node.js version.

Did not find what you were looking for?

If this content did not answer your questions, try searching or contacting our support team for further assistance.

Back to Section navigation