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

Preserve mode for Acquia hooks. #130

Closed
damontgomery opened this issue May 13, 2019 · 1 comment · Fixed by #138
Closed

Preserve mode for Acquia hooks. #130

damontgomery opened this issue May 13, 2019 · 1 comment · Fixed by #138

Comments

@damontgomery
Copy link
Contributor

The artifact-updateCode task throws away all modes (not sure why, a comment would be nice). Acquia Cloud can then not execute the cloud hooks.

I was able to extend this to preserve the mode. Not sure if this causes issues if the directory doesn't exist.

        <!--Copy Acquia Cloud Hooks and preserve their execution permissions. -->
        <copy todir="${artifact.directory}/hooks" overwrite="true" haltonerror="true">
            <fileset dir="${build.dir}/hooks" />
        </copy>

I put this right after the part where most of the files are copied over.

        <!-- List all files that are checked in to git, then use the list to copy them all
             into the artifact. -->
        <tempfile property="tmpfile" destdir="${build.dir}/artifacts" />
        <exec command="git ls-files" dir="${build.dir}" output="${tmpfile}" />

        <copy todir="${artifact.directory}" preservemode="false" mode="750" overwrite="true" haltonerror="true">
            <filelist dir="${build.dir}" listfile="${tmpfile}" />
        </copy>
        <delete file="${tmpfile}" />
@becw
Copy link
Member

becw commented May 23, 2019

I think I did this because everything in the build repo needs to be writable, and when it's not, the artifact can fail to update. I also know that sometimes devs end up with weird permissions on files (e.g. chmod 777 * to try to fix something), and didn't want those types of changes to work their way through to the artifact. It's a brute-force approach, and it sounds like it breaks some things! Perhaps it would make more sense to chmod -R u+w against the artifact repo before copying, and then preserve permissions? Other ideas?

becw added a commit that referenced this issue Nov 27, 2019
…e being squashed to 750, which broke Acquia Cloud hooks (#130).
@becw becw closed this as completed in #138 Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants