Published on: May 1, 2023
5 min read
Users can now define inputs to any includable CI/CD templates. Learn how and see what other CI/CD pipeline developments are coming.
There are exciting new developments to share about our CI/CD templates features, known for their ability to get users up and running quickly with GitLab CI/CD. Our goals for the immediate future are to evolve templates into CI/CD components (more details below) and, soon, to release a CI/CD components catalog to make the reusing and sharing of pipeline configurations easier and more efficient for developers, both inside of their organizations and with the wider developer community. The first step in our journey is to enable users to define inputs to any includable file, ultimately creating more powerful and reusable CI/CD templates.
Here is a short walkthrough on this capability:
In GitLab 15.11, we released, as Beta, the ability to define inputs to any includable file (any CI/CD file that you include in your pipeline). Until now, we've been leveraging environment variables to pass information. As an example, we used environment variables to pass information from an upstream pipeline to a downstream pipeline.
Using environment variables for passing information is like declaring global variables in programming languages – it has an effect on your entire pipeline, which means that the more variables we declare, the more we risk variable conflicts and increased variable scope.
Input parameters are similar to variables passed to the template but exist only inside a specific scope and don't affect other templates in your pipelines. There are several benefits of using inputs, including:
$[[ inputs.* ]]
across all keywords in your CI/CD configuration.This paradigm allows users to build more robust and isolated templates (which will soon evolve into components) and enables users to declare and enforce contracts.
The ability to define inputs to a CI/CD configuration file is available right now and we'd love for users to dive in and begin adding inputs to templates. You can check out the GitLab docs and review this example project to better understand how to use inputs as part of your daily workflow. If you use this feature and have feedback, please share it with us in this issue.
In GitLab 16.0, we are planning to release an experimental version of a CI/CD pipeline component, which will be the first building block of our CI/CD catalog. A pipeline component is a reusable, single-purpose building block that abstracts a single pipeline configuration unit away. To learn more, please check out this example project.
Components are preconfigured CI/CD files that automate the process of building, testing, and deploying software applications. CI/CD components provide:
~latest
version.TL;DR: Using CI/CD components can help streamline the development process, save time, reduce errors, and improve the quality of code.
To further streamline your development processes, improve the quality of your software delivery, and make it easier for developers to discover and use preconfigured components, we’ll be releasing the CI/CD component catalog, which will make using, creating, and sharing CI/CD components much more efficient and user-friendly, and we’re targeting release of this later this year. In the next months, we’ll be sharing more feature updates, blogs, docs, and demos to keep you posted on our journey toward CI/CD components and a CI/CD component catalog. We’re excited for you to test out the new capabilities as they drop, and we look forward to your feedback.
Cover image by Mathias Reding on Pexels.