heroku / heroku-sbt-plugin

An sbt plugin for deploying Heroku Scala applications
MIT License
111 stars 17 forks source link

Failed to determine app name when using git worktrees #35

Closed rethab closed 9 months ago

rethab commented 8 years ago

hi,

when I try to deploy to heroku, it fails with the below exception.

The only difference I could make out is that I'm using git worktrees whereas eg. our ci server makes fresh shallow clones each time.

In my worktree scenario, I have a develop branch, which contains the .git directory and the master branch (from which I'm deploying) is in a separate directory, which doesn't have a .git directory, but only a .git file that points to the "main" git directory.

[info] remote: -----> Launching...
[info] remote:        Released v315
[info] remote:        https://our-app.herokuapp.com/ deployed to Heroku
[info] remote:
[info] -----> Done
java.lang.IllegalArgumentException: Could not find app name: /path/to/project/modules/core/.git/confi
g
    at com.heroku.sdk.deploy.Deployer.<init>(Deployer.java:45)
    at com.heroku.sdk.deploy.BuildsDeployer.<init>(BuildsDeployer.java:24)
    at com.heroku.sdk.deploy.App.<init>(App.java:25)
    at com.heroku.sbt.SbtApp.<init>(SbtApp.scala:13)
    at com.heroku.sbt.HerokuPlugin$autoImport$$anonfun$baseHerokuSettings$2.apply(HerokuPlugin.scala:37)
    at com.heroku.sbt.HerokuPlugin$autoImport$$anonfun$baseHerokuSettings$2.apply(HerokuPlugin.scala:25)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.FileNotFoundException: /path/to/project/modules/core/.git/config
    at com.heroku.sdk.deploy.Toolbelt.getGitRemotes(Toolbelt.java:62)
    at com.heroku.sdk.deploy.Toolbelt.getAppName(Toolbelt.java:20)
    at com.heroku.sdk.deploy.Deployer.<init>(Deployer.java:43)
    at com.heroku.sdk.deploy.BuildsDeployer.<init>(BuildsDeployer.java:24)
    at com.heroku.sdk.deploy.App.<init>(App.java:25)
    at com.heroku.sbt.SbtApp.<init>(SbtApp.scala:13)
    at com.heroku.sbt.HerokuPlugin$autoImport$$anonfun$baseHerokuSettings$2.apply(HerokuPlugin.scala:37)
    at com.heroku.sbt.HerokuPlugin$autoImport$$anonfun$baseHerokuSettings$2.apply(HerokuPlugin.scala:25)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (core/compile:deployHeroku) java.lang.IllegalArgumentException: Could not find app name: /path/to/project/modules/core/.git/config

Versions

jkutner commented 8 years ago

Do you want to run the plugin on multiple modules (i.e. multiple invocations) or just the top level project?

I think what's happening is that the plugin is attempting to run a second time (after the [info] -----> Done), probably on one of the submodules.

rethab commented 8 years ago

No, I don't want it to run on multiple modules.

Please note that it works when the entire project is not in a worktree ;-)

Malax commented 9 months ago

Closing this PR because this repository will be archived. See https://github.com/heroku/heroku-jvm-application-deployer for an alternative CLI to deploy locally compiled Scala applications.