"Bitbucket Team/Project"

101 views
Skip to first unread message

Christian Gagneraud

unread,
Mar 5, 2018, 10:54:25 PM3/5/18
to jenkins...@googlegroups.com
I'm trying the "Bitbucket Team/Project" (which uses the "multibranch Pipeline").
Using "jenkinsci/blueocean:latest" docker image.

When i create a new ""Bitbucket Team/Project"" item, the BB project is
scanned, project is added and repo too. Repo that have a
"/Jenkinsfile" are picked up and built, everything seems to work as
expected.

Now when i go to one of the generated "multibranch pipeline" job, and
click the "View configuration" (no "Configure" accessible), I land on
a page that allows me to edit the job, but I get a Jenkins screenshot
showing "admin is missing Job/Configure permission" in between
"repository name" and "Behaviors" on the
https://jenkins-url/job/job-name/configure page.

When I manually create a custom multi-branch pipeline job with the
same bitbucket branch source, i do not see this message at all, and
there is nothing b/w "repository name" and "Behaviors".

Did I misconfigured something? The admin account is created suing a
pre-configure groovy hook:

-------------------------------------------------------------
def instance = Jenkins.getInstance()

def user = "admin"
def pass = "..."
def hudsonRealm = new HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount(user, pass)
instance.setSecurityRealm(hudsonRealm)

def strategy = new FullControlOnceLoggedInAuthorizationStrategy()
strategy.setAllowAnonymousRead(false)
instance.setAuthorizationStrategy(strategy)
instance.save()
-------------------------------------------------------------

Is it the cause of my problem?

Does anyone has example on how to use `RoleBasedAuthorizationStrategy`
from a groovy script?
I was stuck b/c I couldn't call the private `createAdminRole()` method
(and I'm an absolute noob with groovy and jenkins scripting)

Thanks,
Chris

Kevin Ford

unread,
Mar 6, 2018, 10:42:06 AM3/6/18
to Jenkins Users
Having same issue, been trying to figure out for almost 2 weeks
Reply all
Reply to author
Forward
0 new messages