Allow some gitignored files

Created on 25 October 2024, 29 days ago

Problem/Motivation

We had a problem doing composer install inside artifact_deployment since we need an auth.json file which is generated during the pipeline and present in .gitignore

Proposed resolution

Here is a quick fix patch to add the auth.json file. But a more general approach to tell the tool which files to include anyway would be nice.

diff --git a/ArtifactDeploymentCommands.php b/ArtifactDeploymentCommands.php
index 698d99b..b50cd4f 100644
--- a/ArtifactDeploymentCommands.php
+++ b/ArtifactDeploymentCommands.php
@@ -325,6 +327,7 @@ final class ArtifactDeploymentCommands extends DrushCommands {
     $targetFinder->in($artifactDir)->ignoreDotFiles(FALSE);
     $this->localMachineHelper->getFilesystem()->remove($targetFinder);
     $this->localMachineHelper->getFilesystem()->mirror($this->dir, $artifactDir, $originFinder, ['override' => TRUE]);
+    $this->localMachineHelper->getFilesystem()->copy('./auth.json', $artifactDir . '/auth.json');
 
     $this->localMachineHelper->checkRequiredBinariesExist(['composer']);
     $outputCallback('out', 'Installing Composer production dependencies');

Remaining tasks

Find a good solution to include files which are otherwise excluded. Maybe something like --force-include 'auth.json'

User interface changes

none

API changes

Additional option to provide file paths or patterns to include.

Data model changes

none

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇨🇭Switzerland milanbombschliip

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024