bazooka-ci / bazooka

Continuous Integration and Continuous Deployment Server
http://docs.bazooka-ci.io/
MIT License
60 stars 5 forks source link

Support job pipelining #160

Open jawher opened 9 years ago

jawher commented 9 years ago

Make it possible for a job to trigger other jobs after it's finished.

An example:

ui config:

language: java
jdk: 1.8
archive_success: target/api.war
downstream_success:
  - project: deploy-api
    rev: master
  - project: ui
    rev: master

on success, api job triggers deploy-api and ui.

deploy-api config (which supposes the previous job artifacts are mounted on the /incoming directory:

image: debian:jessie
script:
  - scp /incoming/api.war tomcat-admin:$pwd@staging.acme.intranet:/opt/tomcat/webapps/
  - <restart tomcat>
  - <wait a bit>
downstream_success:
  - project: api-perf
    rev: master
  - project: api-it
    rev: master

etc.

jawher commented 9 years ago

Note that this proposed solution is a poor man's pipeline, as it doesn't support some advanced features of a real pipeline with stages like fanning-in (wait for multiple jobs before continuing).

julienvey commented 9 years ago

What about removing pipelines from the yaml file ?

Each bazooka project would have its build configuration in the yaml file, but not the downstream/upstream dependencies. And we implement the pipelines in the Bazooka API.

With this solution, I think it would remove possible errors, such as

And it would also allow us to implement more complex pipelines, fanning-in, human validation...

For simplification, we could consider each downstream jobs gets the artifacts generated by its upstream job in /incoming.

julienvey commented 9 years ago

A list of useful features for pipelining

We only need to start with sequential workflow (downstream/upstream) and create issues for the other features

A pipeline could be described in a yaml DSL. I will try to add a simple example soon

julienvey commented 9 years ago

Just an idea

entry_point: 
  - name: api
    bzk_project: api-unit   # (optional) bazooka project name (if different of name)
    triggered_by: scm  # (optional) scm, manual... defaults to scm
    triggers: 
      -  api-perf
      -  api-it
wait_for:
  - wait_jobs: 
      - api-perf
      - api-it
    triggers: 
      - deploy-api