Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Build artifact .gitignore is blown away right after it's copied over #1007

Closed
bkosborne opened this issue Jan 23, 2017 · 2 comments
Closed
Labels
Bug Something isn't working

Comments

@bkosborne
Copy link
Contributor

I'm on BLT 8.6.10, but I had the problems before this release as well.

Looks like by default BLT has a .gitignore file that it copies over to the build artifact. However, it's blown away immediately by the rsync command that copies files from the development repo to the artifact repo:

  <target name="deploy:copy:site" description="Copy required files from /docroot/sites to /deploy/docroot/sites." hidden="true">
    <!-- Make sites/${multisite.name} writable so that we can copy files. -->
    <chmod file="${docroot}/sites/${multisite.name}" mode="0777" />

    <exec dir="${repo.root}" command="rsync -a --no-g --delete --delete-excluded --exclude-from=${deploy.exclude_file} ${repo.root}/ ${deploy.dir}/ --filter 'protect /.git/'" logoutput="true" checkreturn="true" level="${blt.exec_level}" passthru="true"/>

    <!-- Set sites/${multisite.name} back to 755 permissions. -->
    <chmod file="${docroot}/sites/${multisite.name}" mode="0755" />
  </target>

  <target name="deploy:copy" description="Copy required files from each /docroot/sites to /deploy/docroot/sites." hidden="true">
    <!-- Use our own .gitignore -->
    <copy file="${deploy.gitignore_file}" tofile="${deploy.dir}/.gitignore" overwrite="true"/>
    <!-- Perform settings copy for each multisite. -->
    <foreach list="${multisite.name}" param="multisite.name" target="deploy:copy:site"/>
  </target>

The deploy:copy:site target is run after the .gitignore file is copied over, and the rsync command will delete any file in the build repo that isn't in the excludes list.

Not sure if I just have something misconfigured? I don't have a custom excludes for what it's worth.

@bkosborne
Copy link
Contributor Author

I wonder what the implications of fixing this are? If it's fixed, I could see some people have unexpected issues with deployments as many things will now potentially be ignored?

@grasmash grasmash added the Bug Something isn't working label Feb 9, 2017
@extensibleseth
Copy link

I had an issue with this. New modules were added to the artifact on deploy, but weren't included in the artifact repo. I updated the deploy/.gitignore to include them but I've had to do it each time we install a contrib module.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants