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

Set up autodeployments to Heroku for tests #22

Open
mariobehling opened this issue Jul 23, 2017 · 8 comments
Open

Set up autodeployments to Heroku for tests #22

mariobehling opened this issue Jul 23, 2017 · 8 comments

Comments

@mariobehling
Copy link
Contributor

Testing the app is important. Please set up autodeployments on each PR to Heroku.

@nikhilrayaprolu
Copy link
Member

@Orbiter @sudheesh001 @daminisatya I am trying to deploy this project on heroku but I get this error when run on heroku local web
image
I am following instructions at this page: https://devcenter.heroku.com/articles/deploying-gradle-apps-on-heroku

@sudheesh001
Copy link
Member

This is because the jar file seems to not point correctly to the Main-Class that needs to be executed. In the gradle , during jar generation task, I think it'll fix itself by adding a jar task with the manifest attribute to it.

jar {
  manifest {
    attributes(
      'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
      'Main-Class': 'net.yacy.grid.<className>'
    )
  }
}

@nikhilrayaprolu
Copy link
Member

@sudheesh001 I will try adding this to build.gradle

@nikhilrayaprolu
Copy link
Member

@sudheesh001 now I am facing this issue,
image
is there any way to know how to use gradle run on heroku? gradle run works perfectly but the problem is with executing java files ourselves. or can we know which commands does Gradle use to run the built jar files?

@nikhilrayaprolu
Copy link
Member

nikhilrayaprolu commented Jul 31, 2017

@daminisatya later I tried making a fat jar as I read that we have to create fatjar to pack dependencies. following https://stackoverflow.com/questions/4871656/using-gradle-to-build-a-jar-with-dependencies but Now I am facing this issue Could not find or load main class net.yacy.grid.mcp.MCP
image
but as per the project net.yacy.grid.mcp.MCP is the main class and it exists at https://github.com/.../main/java/net/yacy/grid/mcp/MCP.java

@sudheesh001
Copy link
Member

Class not found errors are happening because it looks like the corresponding class files aren't available in the jar files. The way to avoid that is by creating a fat jar which has all the dependencies. So you're on the right track.

Can you extract the jar file and see if it contains the MCP.class in it?

@nikhilrayaprolu
Copy link
Member

image

it has the MCP.class file

@sudheesh001
Copy link
Member

Interesting, @Orbiter any reason you see here as to why the jar isn't running.

@mariobehling mariobehling changed the title Set up autodepoyments to Heroku for tests Set up autodeployments to Heroku for tests Jul 9, 2018
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

3 participants