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

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

Merged
merged 2 commits into from
Feb 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions phing/tasks/deploy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,23 @@

</target>

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

<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"/>

<target name="deploy:copy:site:perms-unwritable" description="Make each multisite dir unwritable." hidden="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">
<foreach list="${multisite.name}" param="multisite.name" target="deploy:copy:site:perms-writable"/>
<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"/>
<foreach list="${multisite.name}" param="multisite.name" target="deploy:copy:site:perms-unwritable"/>

<!-- 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>

<target name="deploy:prepare-dir" description="Delete the existing deploy directory and re-initialize as an empty git repository." hidden="true">
Expand Down
1 change: 1 addition & 0 deletions tests/phpunit/Blt/DeployTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function testBltDeployBuild() {
$this->assertFileExists($this->deploy_dir . '/docroot/index.php');
$this->assertFileExists($this->deploy_dir . '/docroot/autoload.php');
$this->assertFileExists($this->deploy_dir . '/composer.lock');
$this->assertFileExists($this->deploy_dir . '/.gitignore');
$this->assertFileExists($this->deploy_dir . '/docroot/sites/default/settings.php');
$this->assertFileNotExists($this->deploy_dir . '/docroot/sites/default/settings/local.settings.php');

Expand Down