-
Notifications
You must be signed in to change notification settings - Fork 220
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
initScmAdapter FAILED :Current Git branch is "(HEAD detached at ac857f3)" and not "development". #183
Comments
Seems that the jenkins doesn't checkout the development branch. It has the revision ac857f3 checked out and tries to run the release task that of course fails because it is not the HEAD of the development branch.
if you manage to get the development branch it will work. |
Hello, I have the same issue. |
Jenkins doesn't checkout the branch to test it. It uses the hashes. Could you explain your jenkins workflow please? I try to find a way that fits to it. Also maybe this helps you? |
We have Feature-based git workflow. Do you need more Details? |
No that's fine. |
4 years and still no result? ... |
Adding 'Check out to local branch' solved it for me |
I am using below:
classpath 'net.researchgate:gradle-release:2.3.4'
gradle version : gradle-2.11
using different branch than master
My configuration for android project is below:
apply plugin: 'net.researchgate.release'
release {
failOnCommitNeeded = true
failOnPublishNeeded = true
failOnSnapshotDependencies = true
failOnUnversionedFiles = true
failOnUpdateNeeded = true
revertOnFail = true
preCommitText = ''
preTagCommitMessage = '[Gradle Release Plugin] - pre tag commit: '
tagCommitMessage = 'JenkinsReleaseBuildTag: '
newVersionCommitMessage = '[Gradle Release Plugin] - new version commit: '
//tagging the release using product.release, build.no, and version
tagTemplate = "${ant.properties['product.release']}.${ant.properties['build.no']}-${version}"
versionPropertyFile = 'gradle.properties'
versionProperties = []
buildTasks = ['clean']
}
I am using checkout function to get the application code:
checkout ([$class: 'GitSCM', branches: [[name: ""]],
userRemoteConfigs: [[credentialsId: "<credentialsId", url: ""]],
extensions: [[$class: 'CleanCheckout']]])
I am using below step to invoke release plugin in the code jenkins Integration server
sh "${gradleHome}/bin/gradle release -Prelease.useAutomaticVersion=true -Prelease.newVersion=${cdAppProperties.getVersion()}"
11:21:52.433 [ERROR] [org.gradle.BuildExceptionReporter]
11:21:52.435 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:21:52.435 [ERROR] [org.gradle.BuildExceptionReporter]
11:21:52.435 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
11:21:52.435 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':initScmAdapter'.
11:21:52.435 [ERROR] [org.gradle.BuildExceptionReporter] > Current Git branch is "(HEAD detached at 53f373c)" and not "development".
11:21:52.435 [ERROR] [org.gradle.BuildExceptionReporter]
11:21:52.435 [ERROR] [org.gradle.BuildExceptionReporter] * Exception is:
11:21:52.436 [ERROR] [org.gradle.BuildExceptionReporter] org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':initScmAdapter'.
11:21:52.436 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69)
11:21:52.436 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
11:21:52.436 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.PostExecutionAnalysisTaskExecuter.execute(PostExecutionAnalysisTaskExecuter.java:35)
11:21:52.436 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:64)
11:21:52.436 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
11:21:52.436 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:52)
11:21:52.436 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
11:21:52.436 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:53)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:203)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:185)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:66)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:50)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:25)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:110)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$4.run(DefaultGradleLauncher.java:154)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.Factories$1.create(Factories.java:22)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:151)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
11:21:52.437 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
11:21:52.438 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
11:21:52.438 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
11:21:52.438 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
11:21:52.438 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
11:21:52.438 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
11:21:52.438 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.tasks.GradleBuild.build(GradleBuild.java:117)
11:21:52.438 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
11:21:52.438 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:227)
11:21:52.438 [ERROR] [org.gradle.BuildExceptionReporter] at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:220)
11:21:52.438 [ERROR] [org.gradle.BuildExceptionReporter] at
The text was updated successfully, but these errors were encountered: