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

Directories always generated with permissions 755 #158

Closed
mzeis opened this issue Aug 21, 2014 · 3 comments
Closed

Directories always generated with permissions 755 #158

mzeis opened this issue Aug 21, 2014 · 3 comments

Comments

@mzeis
Copy link

mzeis commented Aug 21, 2014

Hi,

I want my Jenkins & Phing CI setup to generate all directories with permissions 775 and files with permissions 664 by default. In order to accomplish this I edited etc/init.d/jenkins to pass the argument --umask=002 when calling the daemon. This works for all generated files and directories generated by PHPUnit, PHPMD, PHPCPD, PHP_CodeSniffer etc.

Files generated by phpdox have the permission 664, so that's fine. The problem is that the directories are generated with 755 instead of 775.

My setup:

  • Debian Wheezy
  • Jenkins v1.575
  • Phing 2.8.2
  • PHP 5.4.31-1~dotdeb.1
  • phpDox 0.6.6 (using the PHAR release)

Output of ps auxxx | grep jenkins:

jenkins   2330  0.0  0.0  18416   392 ?        S    10:36   0:00 /usr/bin/daemon --name=jenkins --inherit --env=JENKINS_HOME=/var/lib/jenkins --output=/var/log/jenkins/jenkins.log --pidfile=/var/run/jenkins/jenkins.pid --umask=002 -- /usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1
jenkins   2335  1.5 13.8 1243692 285144 ?      Sl   10:38   3:46 /usr/bin/java -Djava.awt.headless=true -jar /usr/share/jenkins/jenkins.war --webroot=/var/cache/jenkins/war --httpPort=8080 --ajp13Port=-1

My phing call:

<target name="phpdox" description="Generate API documentation using phpDox">
    <exec command="${phpdox.exec} -f ${phpdox.config.file}" />
</target>
  • phpdox.exec=/usr/local/bin/phpdox
  • phpdox.config.file=${phing.dir}/resources/phpdox.xml

My phpdox.xml:

<?xml version="1.0" encoding="utf-8" ?>
<phpdox xmlns="http://xml.phpdox.net/config">
    <project name="phpdox" source="src" workdir="build/phpdox/xml">
        <collector backend="parser" publiconly="false">
            <!-- omitted some rules -->
            <include mask="*.php" />
        </collector>
        <generator output="build/phpdox">
            <build engine="html" output="html"/>
        </generator>
    </project>
</phpdox>

The html and xml directories generated by Jenkins target prepare:

/path/to/build/phpdox/ $ ls -la
total 16
drwxrwxr-x 4 jenkins jenkins 4096 Aug 21 13:42 ./
drwxrwxr-x 9 jenkins jenkins 4096 Aug 21 13:43 ../
drwxrwxr-x 5 jenkins jenkins 4096 Aug 21 13:43 html/
drwxrwxr-x 5 jenkins jenkins 4096 Aug 21 13:43 xml/

The files and directories generated by Jenkins target phpdox:

/path/to/build/phpdox/ $ ls -la html/
total 92
drwxrwxr-x  5 jenkins jenkins  4096 Aug 21 13:43 ./
drwxrwxr-x  4 jenkins jenkins  4096 Aug 21 13:42 ../
drwxr-xr-x 85 jenkins jenkins 20480 Aug 21 13:43 classes/
-rw-rw-r--  1 jenkins jenkins 36261 Aug 21 13:43 classes.xhtml
drwxr-xr-x  2 jenkins jenkins  4096 Aug 21 13:43 css/
-rw-rw-r--  1 jenkins jenkins  1722 Aug 21 13:43 index.xhtml
drwxr-xr-x  9 jenkins jenkins  4096 Aug 21 13:43 interfaces/
-rw-rw-r--  1 jenkins jenkins  5158 Aug 21 13:43 interfaces.xhtml
-rw-rw-r--  1 jenkins jenkins  1791 Aug 21 13:43 namespaces.xhtml
-rw-rw-r--  1 jenkins jenkins  1183 Aug 21 13:43 traits.xhtml

/path/to/build/phpdox/ $ ls -la xml/
total 80
drwxrwxr-x 5 jenkins jenkins  4096 Aug 21 13:43 ./
drwxrwxr-x 4 jenkins jenkins  4096 Aug 21 13:42 ../
drwxr-xr-x 2 jenkins jenkins 12288 Aug 21 13:43 classes/
-rw-rw-r-- 1 jenkins jenkins 28320 Aug 21 13:43 index.xml
drwxr-xr-x 2 jenkins jenkins  4096 Aug 21 13:43 interfaces/
-rw-rw-r-- 1 jenkins jenkins 23325 Aug 21 13:43 source.xml
drwxr-xr-x 2 jenkins jenkins  4096 Aug 21 13:43 traits/

Could this be related to phpdox or one of its dependencies?

Thanks for your help! Please tell me if you need more input.

@theseer
Copy link
Owner

theseer commented Sep 11, 2014

Sorry for leaving this ticket open and unanswered for such a long time.

I yet have to determine what I'm doing differently compared to the other tools you mentioned and how to fix this for phpDox.

@theseer
Copy link
Owner

theseer commented Apr 16, 2015

I'm in the process of wrapping up for the 0.8 release of phpDox. Can you verify if your problem still exists with the current master branch? Particularly the fix for issue #178 (commit 5f46a7c) might have fixed this issue as well.

@mzeis
Copy link
Author

mzeis commented Apr 17, 2015

Looks good! Thank you for hanging in there.

"old" version:

$ phpdox --version
phpDox 0.7.0 - Copyright (C) 2010 - 2015 by Arne Blankerts

$ ls -la build/phpdox/html/
total 48
drwxrwxr-x  5 jenkins jenkins  4096 Apr 17 10:54 ./
drwxrwxr-x  4 jenkins jenkins  4096 Apr 17 10:54 ../
drwxr-xr-x 16 jenkins jenkins  4096 Apr 17 10:54 classes/
-rw-rw-r--  1 jenkins jenkins 10415 Apr 17 10:54 classes.xhtml
drwxr-xr-x  2 jenkins jenkins  4096 Apr 17 10:54 css/
-rw-rw-r--  1 jenkins jenkins  1639 Apr 17 10:54 index.xhtml
-rw-rw-r--  1 jenkins jenkins   931 Apr 17 10:54 interfaces.xhtml
-rw-rw-r--  1 jenkins jenkins  1522 Apr 17 10:54 namespaces.xhtml
drwxr-xr-x  4 jenkins jenkins  4096 Apr 17 10:54 source/
-rw-rw-r--  1 jenkins jenkins   927 Apr 17 10:54 traits.xhtml

master branch:

$ phpdox --version
phpDox 0.7.0-122-g556e0ab - Copyright (C) 2010 - 2015 by Arne Blankerts

$ ls -la build/phpdox/html/
total 48
drwxrwxr-x  5 jenkins jenkins  4096 Apr 17 10:56 ./
drwxrwxr-x  4 jenkins jenkins  4096 Apr 17 10:56 ../
drwxrwxr-x 16 jenkins jenkins  4096 Apr 17 10:56 classes/
-rw-rw-r--  1 jenkins jenkins 10772 Apr 17 10:56 classes.xhtml
drwxrwxr-x  2 jenkins jenkins  4096 Apr 17 10:56 css/
-rw-rw-r--  1 jenkins jenkins  1774 Apr 17 10:56 index.xhtml
-rw-rw-r--  1 jenkins jenkins  1024 Apr 17 10:56 interfaces.xhtml
-rw-rw-r--  1 jenkins jenkins  1615 Apr 17 10:56 namespaces.xhtml
drwxrwxr-x  4 jenkins jenkins  4096 Apr 17 10:56 source/
-rw-rw-r--  1 jenkins jenkins  1020 Apr 17 10:56 traits.xhtml

@theseer theseer closed this as completed Apr 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants