dbt_build:
stage: build
image: xemuliam/dbt
script:
- dbt --version
- dbt docs generate
- apt-get update
- apt-get install -y git
- git config user.email "email"
- git config user.name "username"
- git remote set-url origin https://username:$git_pass@gitlab.com/userlink/dbt.git
- git checkout main
- git add .
- git commit -m "chnages"
- git push origin main
I am trying to push to my gitlab repo the docs generated by dbt. This pipeline works fine. Problem is this pipeline automatically create new job and this procedure happens in loop. How to fix it?
The reason for this is your pipeline triggers by a commit to your repo. And you stage again tries to commit to the same repo which in turn triggers another pipeline.
To push a commit without triggering a pipeline execution in Gitlab, just add [ci skip] or [skip ci], using any capitalization, to your commit message.
for example
git commit -m "[skip ci]committing DBT docs"
This is will tell Gitlab to skip the pipeline run for the above commit.
You will still see an entry in the "Pipelines
" section but with status "Skipped
"(no execution of the pipeline)