Skip to content
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

Automatically deploy susi_server to Heroku with travis #7

Closed
mariobehling opened this issue Oct 10, 2016 · 14 comments
Closed

Automatically deploy susi_server to Heroku with travis #7

mariobehling opened this issue Oct 10, 2016 · 14 comments

Comments

@mariobehling
Copy link
Member

mariobehling commented Oct 10, 2016

Other FOSSASIA projects get deployed automatically to Heroku after pull requests. Please implement the same.

I have set up an app already here: https://susi-server.herokuapp.com

@mariobehling
Copy link
Member Author

Some issue deploying the app. Please see below:

Unzipping /app/tmp/cache/.gradle/wrapper/dists/gradle-2.0-bin/5h57m9vra0mjv9qs45oqtsb5c0/gradle-2.0-bin.zip to /app/tmp/cache/.gradle/wrapper/dists/gradle-2.0-bin/5h57m9vra0mjv9qs45oqtsb5c0
Set executable permissions for: /app/tmp/cache/.gradle/wrapper/dists/gradle-2.0-bin/5h57m9vra0mjv9qs45oqtsb5c0/gradle-2.0/bin/gradle

   FAILURE: Build failed with an exception.

   * What went wrong:
   Task 'stage' not found in root project 'fossasia-susi_server-771cb63'.

   * Try:
   Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

   BUILD FAILED

   Total time: 6.933 secs

! ERROR: Failed to run Gradle!
It looks like your project does not contain a 'stage' task, which Heroku needs in order
to build your app. Our Dev Center article on preparing a Gradle application for Heroku
describes how to create this task:
https://devcenter.heroku.com/articles/deploying-gradle-apps-on-heroku

   If you're stilling having trouble, please submit a ticket so we can help:
   https://help.heroku.com

   Thanks,
   Heroku

! Push rejected, failed to compile Gradle app.
! Push failed

@chashmeetsingh
Copy link
Member

Update:
heroku config:set GRADLE_TASK="build" --app susi-server was set

Error log:
2016-10-19T15:37:22.545167+00:00 app[web.1]: Error: Could not find or load main class org.loklak.LoklakServer

@jigyasa-grover
Copy link
Member

@chashmeetsingh Because it has been renamed to org.loklak.SusiServer

@chashmeetsingh
Copy link
Member

@jig08 I tried deploying the current state of the development branch still the same error pops up, can you recheck the code?
Thanks!

@Orbiter
Copy link
Contributor

Orbiter commented Oct 20, 2016

please check if this helps: 2693cc9

@chashmeetsingh
Copy link
Member

just tried, this comes up
Error: Could not find or load main class org.loklak.SusiServer

@mariobehling
Copy link
Member Author

@chashmeetsingh The build is working now with travis. How to make it run on Heroku?

@chashmeetsingh
Copy link
Member

@mariobehling @Orbiter
please have a look at Settings this should help a little

@Orbiter
Copy link
Contributor

Orbiter commented Oct 25, 2016

This is the log from heroku:

2016-10-25T23:16:19.488212+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=susi-server.herokuapp.com request_id=159a9652-7a6c-446e-af3c-5a796d2605d5 fwd="178.203.233.28" dyno= connect= service= status=503 bytes=

But I don't know what that means. Anybody any idea?

@sudheesh001
Copy link
Member

It looks like heroku is throwing a 503, You can use the same buildpack that we use for loklak_server/ so that it gets the required dependencies before pushing. This documentation can help https://blog.travis-ci.com/2013-07-09-introducing-continuous-deployment-to-heroku/

@mariobehling
Copy link
Member Author

It seems the build was successful shortly, but now failing again.

@chashmeetsingh
Copy link
Member

State changed from crashed to starting
2016-11-04T19:16:10.629024+00:00 heroku[web.1]: Starting process with command `sh bin/heroku_start.sh`
2016-11-04T19:16:12.151029+00:00 heroku[web.1]: State changed from starting to crashed
2016-11-04T19:16:12.135306+00:00 heroku[web.1]: Process exited with status 0
2016-11-04T19:16:11.964069+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2016-11-04T19:16:11.970029+00:00 app[web.1]: starting susi
2016-11-04T19:16:11.974331+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -Xmx350m -Xss512k -Dfile.encoding=UTF-8
2016-11-04T19:16:12.068151+00:00 app[web.1]: Error: Could not find or load main class org.loklak.SusiServer
2016-11-04T19:16:12.078552+00:00 app[web.1]: susi server started at port 4000, open your browser at http://localhost:4000
2016-11-04T20:46:24.955792+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=susi-server.herokuapp.com request_id=b8dd059e-d79d-4918-8945-93d6b142a456 fwd="58.176.218.217" dyno= connect= service= status=503 bytes=

Only issue is its not able to find the main class. I tried but couldn't find a solution

@mariobehling
Copy link
Member Author

Ok, so I have added you guys to the loklak Herokuapp as well. Without looking into detail I have tried to use the loklak Heroku build pack (https://github.com/loklak/heroku_buildpack_ant_loklak) for the susi server instead of Gradle. I guess some code needs to be changed in the build pack to make that work.

@atiabjobayer
Copy link
Member

Susi-server can automatically be deployed through heroku now 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants