How can I share code between multiple steps? Can I define multiple steps in a step repo?

I’m debating going to the next level, and converting some python/bash scripts we wrote to integrate FOSSA into our workflows. But I’m not quite sure what is the best way to do it.

First, FOSSA has their own cli binary, which by their instructions says to install via calling curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash. But this would violate the rule on steps not requiring external dependencies that don’t come from the OS. How should I go about packaging up the CLI in the step?

Next, we wrote a python wrapper around the fossa-cli command, that parses the JSON output of the cli’s analyze and test commands and puts the results into env vars that are exported using envman. What I’d like to do, is create two separate bitrise steps: one for the analyze command, and one for the test command. And each one of those bitrise steps would just our python script with the appropriate parameters. But from what I can see, I can only package up a single step in a step repo. Which means that to do what I want, I’d need two separate step repos. And to not violate the rule about external dependencies, that would mean I’d have to copy the python script into both step repos, which doesn’t feel very DRY.

So is it possible to define multiple steps in the same step repo? What I’m envisioning is a step repo that contains my python script, the fossa cli binary, and both step definitions.

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