Bitrise step dependency version

Hi,

I’m creating my first bitrise step.
I need a dependency which I declare in the step.yml file under deps.
But If I would like to give the user the option to enter a custom version or ‘latest’ of the dependency?
Is there some best practice to do this?
Or should I just remove it from the deps and install it myself in a shell command that afterwards runs my go command?

Friendly regards,

Seppe

Hi @seppe_r,
Nice! We are really happy to hear that you’re working on creating your first step! :wink: If the latest version of the deps would be enough and they are available via apt-get and/or brew you can simply add it in the deps section and the CLI will handle everything for you.
For using custom versions of a dependency according to the user’s preferences the solution would be to use a shell command as you mentioned to download and install the desired version of the tool. Let me know if you’d have any further questions! :slightly_smiling_face:
Best regards,
Tamas

Ok thanks :smiley:

So the deps always updates to the latest version even if already installed?

Is there any sort of example to run the step.sh which runs the go command?

I can see https://github.com/bitrise-steplib/steps-carthage/blob/master/step.sh but is all the creation of the folders necessary if the step.sh is in the same repo as the main.go ? :thinking:

Friendly regards,

Seppe

Hey!

I suggest you to use this post, it is awesome and really handy: https://www.thedroidsonroids.com/blog/how-to-create-bitrise-step-in-go-flutter-example

2 Likes

No, if the tool is already installed it won’t update it. See: Installing tools during a build - Bitrise Docs

If you declare deps for a given Step , the Bitrise CLI will check if that tool is installed, and will install it for you if required.

also

This method is the preferred way of handling (step) dependencies, as the Bitrise CLI will not (re)install the specified tool(s) if it’s already available.