0

I have a task to push tag to the repository :

task tagRepo << {

def gitTagName = 'a11'
def gitTagMessage = 'This s a new tag'
def gitUserName = 'uname'
def gitPassword = 'password'

def credentials = new org.ajoberstar.grgit.Credentials(gitUserName, gitPassword)

def grgit = org.ajoberstar.grgit.Grgit.open(dir: project.rootDir.absolutePath, creds: credentials)

def remotes = grgit.remote.list()
logger.info('git remotes size - ' + remotes.size())
logger.info('git remotes - ' + remotes)

def central = remotes.find { it.name == 'central' }
if (!central) {
    def gitRepoLocation = 'git@bitbucket.org/bluetooth1.git'
    grgit.remote.add(name: 'central', url: gitRepoLocation)
}

grgit.tag.add(name: gitTagName, message: gitTagMessage)
grgit.push(remote: 'central', tag:true)

}

I get the following output : enter image description here

It complains about the credentials but the credentials are correct and have proper permissions

sver
  • 866
  • 1
  • 19
  • 44
  • Can you run your build again with `--info` and post that output (preferably copy/paste rather than screenshot)? This can provide more information about how the authentication is happening. – ajoberstar Aug 02 '16 at 00:35

1 Answers1

0

If you are trying to use your Bitbucket username and password as authentication, you should be using the HTTPS URL, not the SSH one:

https://bitbucket.org/bluetooth1.git
sver
  • 866
  • 1
  • 19
  • 44
ajoberstar
  • 2,575
  • 19
  • 21