{"action":"created","issue":{"url":"https://api.github.com/repos/ajoberstar/gradle-git/issues/145","labels_url":"https://api.github.com/repos/ajoberstar/gradle-git/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/ajoberstar/gradle-git/issues/145/comments","events_url":"https://api.github.com/repos/ajoberstar/gradle-git/issues/145/events","html_url":"https://github.com/ajoberstar/gradle-git/issues/145","id":116450653,"number":145,"title":"Authentication failing when attempting origin push when run inside a jenkins job","user":{"login":"bedge","id":499317,"avatar_url":"https://avatars.githubusercontent.com/u/499317?v=3","gravatar_id":"","url":"https://api.github.com/users/bedge","html_url":"https://github.com/bedge","followers_url":"https://api.github.com/users/bedge/followers","following_url":"https://api.github.com/users/bedge/following{/other_user}","gists_url":"https://api.github.com/users/bedge/gists{/gist_id}","starred_url":"https://api.github.com/users/bedge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bedge/subscriptions","organizations_url":"https://api.github.com/users/bedge/orgs","repos_url":"https://api.github.com/users/bedge/repos","events_url":"https://api.github.com/users/bedge/events{/privacy}","received_events_url":"https://api.github.com/users/bedge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-11-12T00:09:58Z","updated_at":"2015-11-30T14:57:08Z","closed_at":null,"body":"I have a problem where my createReleaseBranch task works when I run it locally, but fails when run from a jenkins CI job.\r\n\r\nHere's the output, note that createReleaseTag works fine, but my createReleaseBranch does not:\r\n```\r\n:workspace:createReleaseTag\r\nExecuting task ':createReleaseTag' (up-to-date check took 0.0 secs) due to:\r\n  Task has not declared any outputs.\r\nRunning [git, tag, -a, 3.50.0, -m, [Gradle Release Plugin] - creating tag:  '3.50.0'.] in [/u0/jenkins/jobs/CAS-admin-create-git-release/workspace]\r\nRunning [git, tag, -a, 3.50.0, -m, [Gradle Release Plugin] - creating tag:  '3.50.0'.] produced output: []\r\nRunning [git, remote] in [/u0/jenkins/jobs/CAS-admin-create-git-release/workspace]\r\nRunning [git, remote] produced output: []\r\nRunning [git, push, --porcelain, origin, 3.50.0] in [/u0/jenkins/jobs/CAS-admin-create-git-release/workspace]\r\nRunning [git, push, --porcelain, origin, 3.50.0] produced output: []\r\n:createReleaseTag (Thread[main,5,main]) completed. Took 0.694 secs.\r\n:createReleaseBranch (Thread[main,5,main]) started.\r\n:workspace:createReleaseBranch\r\nExecuting task ':createReleaseBranch' (up-to-date check took 0.0 secs) due to:\r\n  Task has not declared any outputs.\r\nrelease branch name = release/logan\r\nThe following authentication options are allowed (though they may not be available): [HARDCODED, SSHAGENT, INTERACTIVE, PAGEANT]\r\nusing interactive credentials, if needed\r\nssh-agent not available\r\npageant not available\r\njsch agent proxy not available\r\n```\r\n\r\nI'm hooking into this plugin in my own gradle script using:\r\n```\r\nupdateVersion.dependsOn createReleaseBranch\r\n```\r\nwhere createReleaseBranch is:\r\n```\r\ntask createReleaseBranch() {\r\n\tgroup = \"Release\"\r\n\tdescription = \"Create branch (-Drelease.name=<name>) from current develop head\"\r\n\tdoLast {\r\n\t\tdef release = System.getProperty(\"release.name\")\r\n\t\tif (null == release) {\r\n\t\t\tthrow new GradleException(\"-Drelease.name=.. missing.\")\r\n\t\t}\r\n\t\tdef releaseBranchName = \"release/${release}\"\r\n\t\tprintln \"release branch name = ${releaseBranchName}\"\r\n\t\tdef repo = Grgit.open(project.file('.'))\r\n\t\tdef branchService = repo.getBranch()\r\n\t\tdef developBranch = branchService.getCurrent()\r\n\t\tdef branchStatus\r\n\t\ttry {\r\n\t\t\tbranchStatus = branchService.getStatus(name: \"release/${releaseBranchName}\")\r\n\t\t\tthrow new GradleException(\"Branch ${releaseBranchName} already exists.\")\r\n\t\t}\r\n\t\tcatch(Exception e) {}\t// Expect that branch does not already exist.\r\n\t\tprintln \"About to create branch\"\r\n\t\tbranchService.add(name: releaseBranchName, startPoint: 'develop', mode: BranchAddOp.Mode.TRACK)\r\n\t\tprintln \"Branch created: ${releaseBranchName}, next push\"\r\n\t\ttry {\r\n\t\t\trepo.push(all: true)\r\n\t\t\tprintln \"Push OK\"\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\t// related to  https://github.com/allegro/axion-release-plugin/issues/66 ?\r\n\t\t\tprintln \"Repo push failed, execute manually. This is usually needed from jenkins.\"\r\n\t\t}\r\n\t}\r\n}\r\n```\r\n\r\nI want to create a branch from develop called release/XXX and push it to the origin.\r\n\r\nIs there something I'm missing here?\r\n"},"comment":{"url":"https://api.github.com/repos/ajoberstar/gradle-git/issues/comments/160653084","html_url":"https://github.com/ajoberstar/gradle-git/issues/145#issuecomment-160653084","issue_url":"https://api.github.com/repos/ajoberstar/gradle-git/issues/145","id":160653084,"user":{"login":"eupestov","id":3706908,"avatar_url":"https://avatars.githubusercontent.com/u/3706908?v=3","gravatar_id":"","url":"https://api.github.com/users/eupestov","html_url":"https://github.com/eupestov","followers_url":"https://api.github.com/users/eupestov/followers","following_url":"https://api.github.com/users/eupestov/following{/other_user}","gists_url":"https://api.github.com/users/eupestov/gists{/gist_id}","starred_url":"https://api.github.com/users/eupestov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eupestov/subscriptions","organizations_url":"https://api.github.com/users/eupestov/orgs","repos_url":"https://api.github.com/users/eupestov/repos","events_url":"https://api.github.com/users/eupestov/events{/privacy}","received_events_url":"https://api.github.com/users/eupestov/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T14:57:07Z","updated_at":"2015-11-30T14:57:07Z","body":"It is not always convenient to add the fingerprint to known_hosts (for example if you build server is expendable and tho only constant is its URL). There is a workaround exists:\r\ncom.jcraft.jsch.JSch.setConfig 'StrictHostKeyChecking', 'no'"}}