zulkarnain shah
zulkarnain shah

Reputation: 1059

Travis CI build failed

I'm trying to integrate Travis CI with my GitHub project. I managed to configure Travis plugin successfully with my repository by following Travis getting Started Guide

But when i pushed my first commit after integrating Travis ,it is giving me this error when it auto builds.

/home/travis/build.sh: line 179: ./gradlew: Permission denied
The command "eval ./gradlew assemble" failed. Retrying, 2 of 3.

Below is a screenshot of the Travis build : enter image description here

And these are the lines that i have in my .travis.yml file :

language: java
before_script:
 - chmod +x gradlew

Upvotes: 4

Views: 1513

Answers (3)

Xelian
Xelian

Reputation: 17208

I tried with this configuration:

language: java
jdk:
  - oraclejdk7

sudo: required

before_install:
 - chmod +x gradlew

script:
  - ./gradlew clean build -i --continue

And everything is green now.

Upvotes: 2

FibreFoX
FibreFoX

Reputation: 2858

I tried that "before_script"-version, but it didn't work for me.

After changing before_script to before_install it worked as expected (and no sudo was required)

before_install:
  - chmod +x gradlew

Upvotes: 3

Nikola Despotoski
Nikola Despotoski

Reputation: 50548

In your .travis.yml add these lines:

before_script:
 - chmod +x gradlew

Travis instances are linux and require write permissions for executables that output artifacts.

Upvotes: 6

Related Questions