Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguity in configuration documentation #216

Open
bpstahlman opened this issue Feb 3, 2020 · 5 comments
Open

Ambiguity in configuration documentation #216

bpstahlman opened this issue Feb 3, 2020 · 5 comments

Comments

@bpstahlman
Copy link

According to the README...

Select and configure Git SCM
Add Repository URL, [email protected]:${repositoryOwner}/${repositoryName}.git

But the sample configuration call...

bitbucketpr(projectPath:'<BIT_BUCKET_PATH>', ...)

...doesn't set a key called "Repository URL". The closest thing I see is "projectPath", whose value is listed as <BIT_BUCKET_PATH>. But what exactly is this path? The Bitbucket base URL, or the full URL for the project? Does the plugin append the repositoryOwner and repositoryName to projectPath? E.g., something like...

<BIT_BUCKET_PATH>/rest/api/1.0/projects/${repositoryOwner}/repos/${repositoryName}

Also, how does the configuration performed via bitbucketpr(...) interact with the connection information stored in the Bitbucket endpoint (configured apart from any specific project)? IOW, is it possible to "piggyback" off the connection/credentials information used to checkout the project?

Can this plugin use an SSH key, or is http(s) required? (I'm currently using SSH to checkout the project, but I have a username/password account I could use instead.)

In an attempt to find answers to some of these questions, I searched for the terms "projectPath", "repositoryName", etc. within the plugin's source on GitHub, but those terms weren't even found. Any insights you can provide would be appreciated...

@bpstahlman
Copy link
Author

To make things a bit more concrete... The following configuration doesn't appear to work: specifically, builds aren't triggered when I make a commit on a PR branch.

bitbucketpr(projectPath: 'https://bitbucket.si.lan/bit/scm/foo/bar.git',
    cron: '* * * * *',
    credentialsId: '',
    username: 'someuser',
    password: 'password',
    repositoryOwner: 'foo',
    repositoryName: 'bar',
    branchesFilter: '',
    branchesFilterBySCMIncludes: false,
    ciKey: '',
    ciName: '',
    ciSkipPhrases: '',
    checkDestinationCommit: true,
    approveIfSuccess: false,
    cancelOutdatedJobs: true,
    buildChronologically: true,
    commentTrigger: ''
)

I can get builds to trigger when I use the Jenkins pollSCM() trigger, but nothing I add to the bitbucketpr(...) call seems to have any effect. Am I missing necessary configuration?

@bpstahlman
Copy link
Author

Since making the previous comments, I've discovered (through use of Jenkins' "Pipeline Syntax" feature) that I need to set "bitbucketServer" not the "projectPath" parameter specified in the project README. I wasted a lot of time trying to make things work with "projectPath" before stumbling onto the correct parameter. The README should probably be fixed to spare others the wasted time and frustration...

@CodeMonk
Copy link
Collaborator

CodeMonk commented Feb 7, 2020 via email

@bpstahlman
Copy link
Author

bpstahlman commented Feb 7, 2020 via email

@hilafish
Copy link

hilafish commented Jul 2, 2020

@bpstahlman can you share your configuration? I tried setting the plugin but it's not triggered at all, not upon a PR creation and not as is (I would expect the build to run every minute if I've set cron: '* * * * *').
I tried both projectPath and bitbucketServer, and nothing seems to work, so sharing your final configuration would be a great help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants