0

I have a gradle task :

task tagRepo << {
def gitTagName = 'a4'
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) {


    grgit.remote.add(name: 'central', url: gitRepoLocation)
}

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

}

I run this task : gradlew tagRepo --i I get this output

enter image description here

I have gone through few other links but nothing seem to work in my case till now.

I ran thsi command: $ echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config and Now , I am getting this exception

enter image description here

I have read and write access to the repository still I get this issue

sver
  • 866
  • 1
  • 19
  • 44
  • http://stackoverflow.com/questions/26664551/the-authenticity-of-host-bitbucket-org-131-103-20-168-cant-be-established – tim_yates Jun 03 '16 at 08:42
  • I am not sure how to accept the key. Before accepting , it gives the error – sver Jun 03 '16 at 09:18
  • Run the command via bash, before executing the gradle script is run and then accept the key. It will work later on. You can also [disable strict host checking](http://debuggable.com/posts/disable-strict-host-checking-for-git-clone:49896ff3-0ac0-4263-9703-1eae4834cda3). – Opal Jun 03 '16 at 10:47

0 Answers0