Passing calculated parameters to orbs


I’m working on designing an orb for the company and I’m struggling with the following issue.
Let’s say I have an orb that exposes the command release that accepts a parameter starting-sha. This parameter should be read from somewhere during the CI run - so is not “static”

I tried using the BASH_ENV as described here but no success
This is an example:

      - run:
          name: get starting sha
          command: |
            echo "export SHA=foooo" >> $BASH_ENV # calculated parameter that needs to be passed to orb
      - run:
          name: print sha
          command: |
            echo $SHA
      - oso-ci/release:
          starting-sha: $SHA

Both “print sha” and “oso-ci/release” don’t see the $SHA parameter.

Question: how can I calculate the parameter and pass it to orb?


1 Like

Ok, for those who meets the same problem - it was because the docker image that was used for execution didn’t have bash (it’s a simple alpine one).
After installing bash by

RUN apk update && apk upgrade && apk add bash

the snippet above worked out.

1 Like

Thank you for posting the solution @antonlisovenko! I’d love to hear about your orb once you have it published. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.