Abhijeet Kamble
Abhijeet Kamble

Reputation: 3201

getting error=13 while running Ant build in Jenkins for PHP

I am using jenkins ci for php and following http://jenkins-php.org/index.html.

For jenkins i have configured it and started using the same project Money (Link: https://github.com/sebastianbergmann/money)

After building my job in jenkins and the build crashed. Please find below the console output for the same:

please let me know if you require more details.

Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/Jenkins-PHP/workspace
Cloning the remote Git repository
Cloning repository http://[email protected]:7990/scm/tes/money.git
 > /usr/bin/git init /var/lib/jenkins/jobs/Jenkins-PHP/workspace
Fetching upstream changes from http://[email protected]:7990/scm/tes/money.git
 > /usr/bin/git --version
using .gitcredentials to set credentials
 > /usr/bin/git config --local credential.helper store --file=/tmp/git1537427597399873705.credentials
Setting http proxy: http://172.27.171.92:8080/
 > /usr/bin/git fetch --tags --progress http://[email protected]:7990/scm/tes/money.git +refs/heads/*:refs/remotes/origin/*
 > /usr/bin/git config --local --remove-section credential
 > /usr/bin/git config remote.origin.url http://[email protected]:7990/scm/tes/money.git
 > /usr/bin/git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
 > /usr/bin/git config remote.origin.url http://[email protected]:7990/scm/tes/money.git
Fetching upstream changes from http://[email protected]:7990/scm/tes/money.git
using .gitcredentials to set credentials
 > /usr/bin/git config --local credential.helper store --file=/tmp/git8429183869423354745.credentials
Setting http proxy: http://172.27.171.92:8080/
 > /usr/bin/git fetch --tags --progress http://[email protected]:7990/scm/tes/money.git +refs/heads/*:refs/remotes/origin/*
 > /usr/bin/git config --local --remove-section credential
 > /usr/bin/git rev-parse origin/master^{commit}
Checking out Revision df5c32073a42c94deec649078910a0f3f9200900 (origin/master)
 > /usr/bin/git config core.sparsecheckout
 > /usr/bin/git checkout -f df5c32073a42c94deec649078910a0f3f9200900
 > /usr/bin/git rev-list df5c32073a42c94deec649078910a0f3f9200900
[workspace] $ ant
Buildfile: build.xml

clean:

generate-code:

BUILD FAILED
  /var/lib/jenkins/jobs/Jenkins-PHP/workspace/build.xml:21: 
  Execute failed: 
  java.io.IOException: 
  Cannot run program "/var/lib/jenkins/jobs/Jenkins-PHP/workspace/build/generate-child-classes.php": 
  error=13, Permission denied

or error like this

/var/lib/jenkins/jobs/Jenkins-PHP/workspace/build.xml:21: Execute failed: java.io.IOException: Cannot run program "/var/lib/jenkins/jobs/Jenkins-PHP/workspace/build/generate-child-classes.php": error=13, Permission denied

Upvotes: 0

Views: 2052

Answers (1)

Abhijeet Kamble
Abhijeet Kamble

Reputation: 3201

The problem of getting permission denied is solved by modifying the ant script .

i have added 2 chmod lines in ant script which are as follows.

<chmod file="${basedir}/build/generate-child-classes.php" perm="ugo+x"/>
<chmod file="${basedir}/build/tools/**" perm="ugo+x"/>

these lines are added within the generate code target as :

<target name="generate-code" description="Generate Currency-specific subclasses of Money and autoloader code">
 <chmod file="${basedir}/build/generate-child-classes.php" perm="ugo+x"/>
<chmod file="${basedir}/build/tools/**" perm="ugo+x"/>
  <exec executable="${basedir}/build/generate-child-classes.php"/>

  <exec executable="${basedir}/build/tools/phpab.phar">
   <arg value="--output" />
   <arg path="src/autoload.php" />
   <arg path="src" />
  </exec>
 </target>

Upvotes: 1

Related Questions