Nail Gilaziev
04/27/2018, 4:15 PMtask stage(dependsOn: ['shadowJar'])
Newbie user can stuck with it a little bit)
more info here:
https://devcenter.heroku.com/articles/deploying-gradle-apps-on-heroku#verify-that-your-build-file-is-set-up-correctlyNail Gilaziev
05/01/2018, 10:10 AMDeactivated User
05/01/2018, 10:11 AMDeactivated User
05/02/2018, 9:32 AMstage
task is needed. If you are providing the binaries and you are specifying a Procfile
already that just runs that jar. In fact, I did the tutorial without it and it worked.
Have you followed the tutorial step by step?Nail Gilaziev
05/03/2018, 9:21 AMIf you are providing the binariesNo, I do not provide binaries. Binaries excluded in .gitignore and heroku compile fatjar by himself. And it compile it by calling stage gradle task. This task depends on shadowJar. And shadowJar produce fatJar that will be runned by command specified in Procfile
remote: -----> Gradle app detected
remote: -----> Installing JDK 1.8... done
remote: -----> Building Gradle app...
remote: -----> executing ./gradlew stage
remote: :compileKotlin
remote: :compileJava NO-SOURCE
remote: :processResources
remote: :classes
remote: :shadowJar
remote: :stage
remote:
remote: BUILD SUCCESSFUL in 22s
remote: 3 actionable tasks: 3 executed
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 59.3M
remote: -----> Launching...
remote: Released v5
remote: <https://afternoon-sierra-23732.herokuapp.com/> deployed to Heroku
remote:
remote: Verifying deploy... done.
To <https://git.heroku.com/afternoon-sierra-23732.git>
ffff2df..878d4d0 master -> master
Deactivated User
05/03/2018, 9:24 AMNail Gilaziev
05/03/2018, 10:15 AMgit push heroku master
after this command console output tail is:
BUILD SUCCESSFUL in 27s
remote: 3 actionable tasks: 3 executed
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 59.3M
remote: -----> Launching...
remote: Released v6
remote: <https://afternoon-sierra-23732.herokuapp.com/> deployed to Heroku
remote:
remote: Verifying deploy... done.
But this url doesn't return text - It's alive from ktor.Nail Gilaziev
05/03/2018, 10:21 AMNail Gilaziev
05/03/2018, 10:22 AM2018-05-03T10:13:46.914241+00:00 heroku[router]: at=error code=H20 desc="App boot timeout" method=GET path="/" host=<http://afternoon-sierra-23732.herokuapp.com|afternoon-sierra-23732.herokuapp.com> request_id=72205859-48b7-4cef-a2ea-cf7d8a7c191c fwd="37.139.13.226" dyno= connect= service= status=503 bytes= protocol=https
2018-05-03T10:14:26.810037+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 90 seconds of launch
2018-05-03T10:14:26.810118+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-05-03T10:14:26.881145+00:00 heroku[web.1]: Process exited with status 137
2018-05-03T10:14:27.070536+00:00 heroku[web.1]: State changed from starting to crashed
2018-05-03T10:18:40.696127+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=<http://afternoon-sierra-23732.herokuapp.com|afternoon-sierra-23732.herokuapp.com> request_id=ba58ad5a-20d0-4254-863b-bbc7967303b8 fwd="37.139.13.226" dyno= connect= service= status=503 bytes= protocol=https
2018-05-03T10:18:41.169479+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=<http://afternoon-sierra-23732.herokuapp.com|afternoon-sierra-23732.herokuapp.com> request_id=2cadd1be-54fb-4612-9f52-d3ee752a5fe0 fwd="37.139.13.226" dyno= connect= service= status=503 bytes= protocol=https
2018-05-03T10:18:42.093798+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=<http://afternoon-sierra-23732.herokuapp.com|afternoon-sierra-23732.herokuapp.com> request_id=fdf4bd5e-57c3-4fe5-920b-949e372ad049 fwd="37.139.13.226" dyno= connect= service= status=503 bytes= protocol=https
2018-05-03T10:18:42.213904+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=<http://afternoon-sierra-23732.herokuapp.com|afternoon-sierra-23732.herokuapp.com> request_id=dc39b497-63ed-475d-8c77-76343be9e141 fwd="37.139.13.226" dyno= connect= service= status=503 bytes= protocol=https
2018-05-03T10:18:42.921045+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=<http://afternoon-sierra-23732.herokuapp.com|afternoon-sierra-23732.herokuapp.com> request_id=63228b88-d17d-4bd0-8c59-2775385c0aee fwd="37.139.13.226" dyno= connect= service= status=503 bytes= protocol=https
Deactivated User
05/03/2018, 10:24 AMDeactivated User
05/03/2018, 10:25 AMDeactivated User
05/03/2018, 10:25 AMDeactivated User
05/03/2018, 10:25 AMNail Gilaziev
05/03/2018, 10:26 AMDeactivated User
05/03/2018, 10:27 AMDeactivated User
05/03/2018, 10:27 AMDeactivated User
05/03/2018, 10:27 AMDeactivated User
05/03/2018, 10:27 AMDeactivated User
05/03/2018, 10:28 AMDeactivated User
05/03/2018, 10:29 AMNail Gilaziev
05/03/2018, 10:33 AMval port = Integer.valueOf(System.getenv("PORT"))
embeddedServer(Netty, port, reloadPackages = listOf("heroku"), module = Application::module).start()
But how to configure it with HOCON application.conf
because this file is not valid
ktor {
deployment {
port = $PORT
}
application {
modules = [ru.gs.tests.wsupper.AppKt.main]
}
}
And after deploying you get this error
Exception in thread "main" com.typesafe.config.ConfigException$Parse: application.conf @ jar:file:/app/build/libs/wsupper-0.1-all.jar!/application.conf: 3: Expecting a value but got wrong token: 'P' ('$' not followed by {, 'P' not allowed after '$') (if you intended 'P' ('$' not followed by {, 'P' not allowed after '$') to be part of a key or string value, try enclosing the key or value in double quotes, or you may be able to rename the file .properties rather than .conf)
Deactivated User
05/03/2018, 10:33 AMDeactivated User
05/03/2018, 10:33 AMDeactivated User
05/03/2018, 10:34 AMNail Gilaziev
05/03/2018, 10:40 AMktor {
deployment {
port = ${PORT}
}
}
Deactivated User
05/03/2018, 10:40 AMDeactivated User
05/03/2018, 10:41 AMDeactivated User
05/03/2018, 10:41 AM