mooncat69
mooncat69

Reputation: 155

Jenkins-X with BitBucket cloud

I've installed Jenkins X on EKS using instructions from https://github.com/jenkins-x/jx-docs/blob/master/content/developing/git.md so that I can use BitBucket with Jira.

jx install --no-default-environments
jx create git server bitbucketcloud -n BitBucket https://bitbucket.org
jx create git token -n BitBucket myusername

When I went to create an environment using

jx create env staging --git-provider-url=https://bitbucket.org

My account is linked to my company team, but the command only gave me an Organisation choice of my username. Continuing, I got a 401 error and could not continue.

Is this supported? I have reinstalled Jenkins-X a few times previously and got it working with GitHub for environments plus BitBucket for code repositories.

I've noticed as well that if I want to create a repository in my Organisation (Team), I must also supply a Project. Is this going to be a problem?

I'd much prefer to do everything in BitBucket, but I may have to go with GitHub if it plays much better with Jenkins X.

Thanks

Upvotes: 2

Views: 1835

Answers (1)

amenic
amenic

Reputation: 316

My understanding is that you want to use a Git Provider other then the default gitea. If you want to do it at the time of jx's first installation, all you need to do is passing all parameters you need directly to jx install [args] command.

Here is a sample which contains enough arguments to make your installation fully working onto your cluster. Be sure to use (or reuse) the ingress in place, if already provisioned by your vendor.

jx install \
    --provider <your-provider> \
    --git-provider-kind bitbucketcloud \
    --git-provider-url https://bitbucket.org \
    --default-environment-prefix <your-prefix> \
    --git-username <your-username> \
    --environment-git-owner <your-organisation> \
    --git-api-token <your-api-token> \
    --git-private \
    --no-tiller \
    --verbose \ 
    --log-level debug

It follows command's specification: https://jenkins-x.io/commands/jx_install/

When it comes to BitBucket' project doubt, the "project" concept is something that strictly concerns Bitbucket, i.e. something you don't have on other git providers. That being said, jx doesn't provide BitBucket with any project specification at the time I'm writing, so that BitBucket default behavior in such cases, is that the repository will be created into the oldest Project you've defined.

Anyway repositories can be freely moved across different projects in your account.

Upvotes: 4

Related Questions