Day 10: SparrowCI pipelines cascades of fun

Remember the young guy in the previous SparrowCI story? We have not finished with him yet …

Because New Year time is coming and brings us a lot of fun, or we can say cascades of fun …

So, our awesome SparrowCI pipelines plumber guy is busy with sending the gift to his nephew:

sparrow.yaml:

tasks:
  -
    name: zef-build
    language: Bash
    default: true
    code: |
      set -e
      cd source/
      zef install --deps-only --/test .
      zef test .

Once a gift is packed and ready, there is one little thing that is left.

– And that is – to send the gift to Santa, to His wonderful (LAP|Raku)land

So, SparrowCI guy gets quickly to it, and he knows what to do (did not I tell you , he is very knowledgeable? :-), creating a small, nifty script to publish things to Santa’s land:

.sparrow/publish.yaml

image:
  - melezhik/sparrow:debian

secrets:
  - FEZ_TOKEN
tasks:
  - name: fez-upload
    default: true
    language: Raku
    init: |
      if config()<tasks><git-commit><state><comment> ~~ /'Happy New Year'/ {
        run_task "upload"
      }
    subtasks:
    -
      name: upload
      language: Bash
      code: |
        set -e
        cat << HERE > ~/.fez-config.json
          {"groups":[],"un":"melezhik","key":"$FEZ_TOKEN"}
        HERE
        cd source/
        zef install --/test fez
        head Changes
        tom --clean
        fez upload
    depends:
      -
        name: git-commit
  - name: git-commit
    plugin: git-commit-data
    config:
      dir: source

Didn’t you notice, SparrowCI lad needs to tell Santa’s his (-fez-token-) secret to do so, but don’t worry! – Santa knows how to keep secrets!

secret

Finally, SparrowCI plumber ties “package” and “publish” things together and we have CASCADING PIPELINES of FUN

sparrow.yaml:

# ...
followup_job: .sparrow/publish.yaml

And, here we are, ready to share some gifts:

git commit -m "Happy New Year" -a
git push

Remember, what should we say to Santa, once we see him? Yes – Happy New Year!

This “magic” commit phrase will open door in Santa’s shop and deliver the package straight to it!

publish

That is it?

Yes and … no – you can read all that technical stuff in more boring, none holiday manner on SparrowCI site, but don’t forget – SparrowCI is FUN.

One thought on “Day 10: SparrowCI pipelines cascades of fun

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.