Private Bitrise steps?

I have a custom workflow that I’m looking to move into a Bitrise Go step for performance reasons. Is there support for publishing private steps?

1 Like

Hi @bootstraponline,

Thanks for asking this here! :wink:

Publishing, no. But using, yes.

You’ll have to use the “direct git clone” reference (something like git::GIT-CLONE-URL@BRANCH - examples: https://github.com/bitrise-io/bitrise/blob/master/_examples/tutorials/steps-and-workflows/bitrise.yml) in your bitrise.yml. Other than that, the only thing that matters there is that the host should be authenticated for accessing that private repo. E.g. if you use an SSH git clone url, you can have the private step after the Activate SSH key step, if that activates an SSH key which can access the private step repo.

There’s no magic here, if you use a git:: style step reference that means that the step will have to be git clone d from the specified URL.

That said I’d suggest you to not to use private step repos. It’s way easier both short and long term to have the step repo as a public repo, and simply provide the secret/private infos as inputs of the step, in your bitrise config (bitrise.yml).

If you have any questions just let us know!

2 Likes

Hi @viktorbenei,
I have a question.
I am trying to reference git::git@our.privaterepo.com:8888/username/project.git.
However, you are attempting to connect 22 port instead of 8888(any other ports other than 22).

Do you have any idea to resolve that or is it a known issue?
Thank you

Hi @mike.rakuten :wave:

Can you please copy paste the error from the log? It might not be the port that’s causing it but authentication or similar.

Hi @viktorbenei, Thanks for the reply.

Here is the error log. I replaced the repo url with a random one, since it’s a private repo, but the format is the same.

Preparing Step (Server Tools) failed: activate git step reference: command failed with exit status 128 (git "clone" "--recursive" "--branch" "main" "--depth=1" "git@some.gitrepo.com:8888/mike/bitrise-step-some-operation.git" "."): Cloning into '.'... ssh: connect to host some.gitrepo.com port 22: Operation timed out fatal: Could not read from remote repository. (exit code: 1)

@viktorbenei

I gave another try with more correct URL.

What I am trying to say is that if we use different port than 22 in git clone, we need to configure ssh config or put the port number into ssh url, such as ssh://ssh.example.com:8888/user/project.git.

I specified ssh:// url in bitrise.yml, but it failed.

    - git::ssh://git@git.example.com:8888/mike/bitrise-step-some-operation.git@main:
        title: Some Operation
Preparing Step (Server Tools) failed: activate git step reference: command failed with exit status 128 (git "clone" "--recursive" "--branch" "main" "--depth=1" "ssh://git" "."): Cloning into '.'... fatal: no path specified; see 'git help pull' for valid url syntax (exit code: 1)

I came here to say the same, you either set up a config in ~/.ssh/config for your server, or use the ssh:// syntax. But looks like the CLI doesn’t support that synax (yet), it treats @ as the symbol that separates the URL from the version numer.

2 Likes