danger: Unable to Setup with Bitbucket Server
Hey,
we are currently trying to integrate danger into our internal infrastructure. Sadly we are unable to do so, as the docs seem to be incomplete.
version: computer:App user$ gem list | grep danger danger (4.2.1)
executing danger:
computer:App user$ bundle exec danger local --verbose
bundler: failed to load command: danger (/usr/local/bin/danger)
RuntimeError: danger cannot find your git remote, please set a remote. And the repository must host on GitHub.com or GitHub Enterprise.
/Library/Ruby/Gems/2.0.0/gems/danger-4.2.1/lib/danger/ci_source/local_git_repo.rb:61:in `raise_error_for_missing_remote'
/Library/Ruby/Gems/2.0.0/gems/danger-4.2.1/lib/danger/ci_source/local_git_repo.rb:43:in `initialize'
/Library/Ruby/Gems/2.0.0/gems/danger-4.2.1/lib/danger/danger_core/environment_manager.rb:30:in `new'
/Library/Ruby/Gems/2.0.0/gems/danger-4.2.1/lib/danger/danger_core/environment_manager.rb:30:in `initialize'
/Library/Ruby/Gems/2.0.0/gems/danger-4.2.1/lib/danger/commands/local.rb:70:in `new'
/Library/Ruby/Gems/2.0.0/gems/danger-4.2.1/lib/danger/commands/local.rb:70:in `run'
/Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.0.0/gems/danger-4.2.1/bin/danger:5:in `<top (required)>'
/usr/local/bin/danger:23:in `load'
/usr/local/bin/danger:23:in `<top (required)>'
environment vars: export DANGER_BITBUCKETSERVER_USERNAME=username export DANGER_BITBUCKETSERVER_PASSWORD=password export DANGER_BITBUCKETSERVER_HOST=address-to-bitbucket-server (e.g. bitbucket.local.com) export GIT_URL=ssh://git@bitbucket.local.com:7999/PROJECTNAME/REPONAME.git
Are there any major missteps on our side?
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 32 (17 by maintainers)
For anyone interested, I got
danger (5.8.2)working locally (for testing purposes) with Bitbucket Server as follows:Couple of notes:
JENKINS_URL- It can technically be anything. It is just to force Jenkins behavior of DangerGIT_URL- Address of your GIT repo (set by Jenkins by default)CHANGE_ID- ID of the PRMake sure your locale is UTF-8 to avoid crashes
ISSUE RESOLVED
I just changed DANGER_BITBUCKETSERVER_HOST=“https://XXX@git.TTT.com/path/to/project.git” to DANGER_BITBUCKETSERVER_HOST=“https://git.TTT.com” in above command & it worked. Thank you very much @orta @jeroenvisser101 for you help.