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:
- Click Settings > CI/CD.
- In the General pipelines section, click Expand and then enter the path to the custom
.gitlab-ci.yml
file. - Click Save changes.
Customizing jobs
For any default job run by Code Studio Auto DevOps, you can:
- Enable or disable the job using an environment variable.
Add custom scripts to Code Studio jobs.
- Replace the default script with your own custom script.
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.