#running dagger pipeline locally after each commit to main
1 messages · Page 1 of 1 (latest)
hey @valid geode ! Dagger running locally after each commit is as simple as doing dagger run against your Dagger pipelines
are you looking for an automated way to trigger those pipelines locally after a commit is made?
yes exactly. I am not sure how i would automate local builds after a commit on a branch. If someone has already done that would save me lots of time
this is not something that's specific to Dagger or any other CI tool. There are some tools out there you can use to set post-commit git hooks
https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks . You're looking for the post-commit hook
Btw.: If you use python (or JS I think 🤔) you might also look into pre-commit. This tool uses git-hooks under the hood and can be configured like a pipeline via yaml. You can specify commit- and also push-trigger and run your custom dagger pipeline:
- repo: local
hooks:
- id: pytest-unittests
name: unittests
entry: pytest tests/unittests
language: system
types: [python]
pass_filenames: false
stages: [commit]
- id: dagger-pipeline
name: pipeline-unittests
entry: python pipeline/ci_main.py
language: system
stages: [push]
Of course, there a lot more things you can do with pre-commit.