I've managed to create a CircleCI build that triggers a subsequent build using their API using curl
. I've added this to my circle.yml
:
test:
override:
- mvn test -s settings.xml
- mvn deploy -Prun-its -s settings.xml
- curl -v -X POST https://circleci.com/api/v1/project/alexec/docker-maven-plugin/tree/master?circle-token=$CIRCLE_TOKEN
How do I trigger only if all of the previous steps are green?
I think you should do this in the deployment
section: Since this is - by definition - only run if everything is fine, this should do the trick.
See their documentation on deployment for details. There it says:
These commands are triggered only after a successful (green) build.
You should have a requires
variable in your job that you want to run only if the previous job has run. So you give the requires
variable a value of the job name that you want to succeed first before the jobs resume running.
See this example: https://circleci.com/docs/2.0/configuration-reference/
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