Skip to main content

We have a parent-child pipeline (one simply calling another in a different project like so)

Trigger TransformationPipeline:  stage: Downstream  inherit:    variables: false  variables:    _PIPELINE_FILE_NAME: ingestion_15Min-ci.yml  trigger:    project: "/transformation/transformation-template"    branch: $CI_COMMIT_REF_NAME

 

and I would like to pass a variable downstream.

The documentation doesnt make it exactly clear how to do this, and the gitlab says it has a keyword of trigger:forward

 

So just after the correct way to do this, and possibly to confirm how the variable would be used in the child:

ingestion_15Min-ci.yml:

include:  - /pipelines/includes/bootstrap.yml    - /pipelines/includes/local_includes/ingestion/clear_staging.yml   - /pipelines/includes/local_includes/ingestion/direct_ingestion_orchestrator.yml  ## MATE pipeline content  - /mate_15Min-ci.yml

mate_15Min-ci.yml:

- /pipelines/includes/local_includes/modelling_and_transformation/build_15_models.yml

 

build_15_models.yml:

Build all 15 Models:  extends:    - .modelling_and_transformation_base    - .agent_tag  variables:    TRANSFORM_ACTION: RUN    TRANSFORM_MODEL_SELECTOR: models/15  stage: DT Build 15Models  script: /dataops  retry : 1  icon: ${TRANSFORM_ICON}

models/15/BuildModel.sql

Within here is where I want to use the new variable

Change from

 where			{% if is_incremental() %} 			m.SINKMODIFIEDON >= (select max(Modified_Date) from {{ this }}) and 			{% endif %}  			 CAST(MSERP_ACCOUNTINGDATE AS DATE) is not null

To

where {% if is_incremental() %}

m.SINKMODIFIEDON >= (select max(Modified_Date) - NEWVARIABLEHERE from {{ this }}) and

{% endif %} CAST(MSERP_ACCOUNTINGDATE AS DATE) is not null

 

 

 

Be the first to reply!

Reply