5

So I recently made the jump from Ant to Gradle and it is wonderful. However, I am having some issues getting gradle to run from a server.

I have a script that I can manually execute to run all of my gradle tasks to build my app. This works perfectly when I am logged into the machine. The problem is that I am now trying to kick off that script for a nightly build. And in order to kill two birds with one stone I launched a JBoss server with a custom service to call that script nightly and call the script with a specific hooks from GitHub.

Does anyone know what the difference would be between calling the script when I am logged into the machine and having a server (which I started when I was logged in) call the same script?

The only information I get from the console:

    gradle: command not found
Batiaev
  • 1,173
  • 1
  • 14
  • 30
cain4355
  • 1,094
  • 1
  • 10
  • 22
  • 1
    At the first glance it looks like your environment (path variable?) is different. But what you are trying to do sounds a little bit strange to me - or I just didn't get it. Do you try to use jboss as a CI server? One more hint. Try to use the gradle wrapper (https://docs.gradle.org/current/userguide/gradle_wrapper.html) so you are more independent from your environment. – TobiSH May 04 '16 at 06:29

1 Answers1

12

As say @TobiSH First of all check your environment echo $GRADLE_HOME && echo $PATH

Path to gradle can be setting up only for your user and not for all system

.profile or .bashrc instead of /etc/environment (for linux systems)

Second option is try to use gradle wrapper

$ gradle wrapper

to be more independent from your environment

You can read more about different user and system variable here (windows)

For ubuntu and other linux based systems here

Community
  • 1
  • 1
Batiaev
  • 1,173
  • 1
  • 14
  • 30