Pipeline Trigger
Introduction
The Pipeline Trigger is the first pillar of creation and is responsible for initiating the pipeline when new code is committed to the repository and collecting the necessary dependencies.
Using the Pipeline
Step 1: Include the Pipeline Configuration
To use the Pillars of Creation, add the following configuration to your project’s .gitlab-ci.yml
file:
variables:
UPSTREAM_BRANCH: main
include:
- project: Structsure/Pipelines/pillars2
file: pipeline/pipeline.yaml
ref: ${UPSTREAM_BRANCH}
Explanation
-
variables
:UPSTREAM_BRANCH
: Defines the branch of the Pillars of Creation pipeline to use. By default, it is set tomain
. You can modify this to target a different branch or tag as needed.
-
include
:- The
include
keyword imports the pipeline configuration from a specified external project. project
: Points to the location of the Pillars of Creation pipeline. In this case,Structsure/Pipelines/pillars2
is the group and project name. Verify that the path is correct in your GitLab instance.file
: Specifies the path to the pipeline configuration file within the project. In this case, it’spipeline/pipeline.yaml
.ref
: References the branch or tag to be used, dynamically set by theUPSTREAM_BRANCH
variable.
- The
Replace Structsure/Pipelines/pillars2
with your actual project path if different.
Step 2: Trigger the Pipeline
You can trigger the pipeline by creating a branch, pushing changes, and creating a merge request. The pipeline will automatically execute the defined stages and jobs.
-
Create a new branch:
git checkout -b <branch-name>
-
Make changes to your code, commit them, and push the branch to GitLab:
git add .
git commit -m "Add new feature"
git push origin <branch-name> -
Create a merge request (MR) by navigating to the repository in GitLab and selecting Merge request. This will initiate the pipeline for the changes in the MR.