I have a project where I'd like to use GitLab CI to automate the following:
So far I've solved 1 by creating a simple job called my_test_job
that successfully runs my tests on every branch push using mvn verify
.
How can I solve 2? The command to build the project is mvn package
, but I don't know how to have this run on every commit of a pushed branch.
My current gitlab-ci.yml file:
image: maven:3.3.3-jdk-8
stages:
- test
my_test_job:
script: mvn verify
tl;dr - I'd like GitLab CI to confirm that each commit within a pushed feature branch compiles without error.
Thanks!
Unfortunately, Gitlab currently cannot be configured to automatically build all commits: https://gitlab.com/gitlab-org/gitlab-ce/issues/14792
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With