dnephin/dobi

source/artifacts script

siredmar opened this issue · 1 comments

It would be nice if dobi had a way to pass a script that checks own source/artifacts patterns besides the already present local files checks.
For example if i use dobi to deploy some deployment to kubernetes, i'd like to check the dependencies for my deployment, e.g. if something like cert-manager is already present. If the cert-manager is already present, the depends section would be skipped for my deployment.
The resource would be marked fresh when the script returns 0, otherwise the image/job will be build/triggered.

Proposal:
A new property called sources-artifact-job that refers to a dobi job that either fails (returns 1) or succeeds (returns 0).

Example:

meta:
  project: test

image=bash:
    image=bash
    tags: [latest]
    pull: once

image=checkimage:
    image=checkimage
    tags: [latest]
    pull: once

# this job returns either 0 or 1
job=check-dependency-job:
    use: checkimage
    command: /check.sh

job=dependency-job:
    use: bash
    command: /do-something-as-dependency.sh
    sources-artifact-job: check-dependency-job

job=main-job:
    use: bash
    command: /do-something.sh
    depends: [dependency-job]

I like this idea!