GitLab self hosted


#1

Hi,

I’m trying to setup Bitrise access to our self hosted instance of GitLab.
Problem is that our configuration doesn’t allow ssh access to the repos from a network that is not in our VPN so only https access is granted.
But our repositories are private, therefore Bitrise fails to access.

We managed to grant access to BuddyBuild: GitLab generates a Private Access Token that grants access to its API, that BuddyBuild uses to access the repo.
Is there any way to achieve the same with Bitrise?
Do you have any hint about the next steps?

I’ve just started a new job in a new company and since I’ve already used Bitrise in past I was looking forward to use it in here as well.

Thanks,
Alessandro


Pipeline in GitLab
#2

Hi @Wolf,

We definitely plan to address this use case. In the meantime if you can’t use SSH setup for a private repo this is how you can get add the repo:

  1. Pick any public sample repo, e.g.: https://github.com/bitrise-samples/sample-apps-android-sdk22.git
  2. Register this on bitrise.io
  3. Once the registration is done, go to Settings and change the Git Clone URL to the actual one
  4. Install the Bitrise CLI: https://www.bitrise.io/cli
  5. Open your Terminal and cd into the repo root (ideally do a clean git clone too, but not required)
  6. In the repo’s root dir (in Terminal) run: bitrise init (this will generate a bitrise.yml in that directory.)
  7. Open the Workflow editor of the app on bitrise.io and copy paste the bitrise.yml from your Mac/Linux into the editor’s bitrise.yml tab

In your case, to use a private https repo you’ll have to do one more thing: replace the Activate SSH Key step with Authenticate host with netrc and configure that step for your server. Note: password can be the GitLab Private Access Token I believe.

That should be all. If you have any questions just let us know! :slight_smile:


#3

Hi Viktor,

thanks for the quick reply.
I’m trying your steps but when I run bitrise init I get FATA[14:11:46] Plugin (init) not installed.
I guess I’m missing something here.

I’m on OSX, the brew update && brew install bitrise went well and Bitrise 1.12.0 is installed.


#4

Ahh, indeed - I’ll file a bug report for the CLI, the missing step is:

bitrise setup

After this you can run the bitrise init (or any other command) as this will ensure everything’s prepared / all plugins (like the init one) are available.

This is auto-performed the first time you run a build, otherwise it has to be called manually (but should not be for init, so I’ll create the bug report :wink: )


#5

Great, that worked! :slight_smile:

I’ll complete the remaining steps in a few hours and I’ll let you know in case of issues.
Thanks for your help, appreciated!

Alessandro


#6

No problem, thanks for the feedback and sorry for the inconvenience! If you’d have any questions just let us know! :wink:


#7

Hi Viktor,

sorry to bother you again but I’m trapped on another issue.
I’m not actually sure it’s self-hosted-related but I’m giving it a go, in case we can always move it to a separate thread.

In my buddybuild configuration there is a nice feature: whenever I create a Merge Request on GitLab a new build is triggered on BuddyBuild (that’s easy to achieve with bitrise too) and the Merge Request shows a link to the build as “pipeline” and the Merge buttons switches to “Merge when pipeline succeeds” (see attached picture).
That’s really cool and it’s something I’m trying to achieve with Bitrise as well.

Is there any way you can help me with this matter?
I’ve been trying different configurations of webhooks but with no success.

Thanks for your help,
Alessandro

09


#8

UPDATE: for reporting back the status of the build to a self hosted GitLab instance we now have a Step: GitLab status step v0.9.0 released

This is of course just the first step, we plan to support this use case better, from adding a new repo to having the setup prepared without adding an additional step, but for now the Step can be used for reporting back the status.

If you’d have any questions just let us know! :slight_smile:


#9

Hello,
Could you please share a .yml with an example connection to a ‘xxx’ self hosted instance of GitLab?
Thanks


#10

Hi @ezfepo!

Since this thread, things have become a lot easier! Please see our guide here: https://devcenter.bitrise.io/getting-started/signing-up/self-hosted-gitlab/