Metadrop / drupal-artifact-builder

Helper to generate drupal artifacts
0 stars 1 forks source link

Add a config file at project level to manage complex situations. #6

Open juanjol opened 3 months ago

juanjol commented 3 months ago

It would be useful to be able to add at project level a yml file in which to configure which files should not be in the artifact (for example to remove the core tests folder) or other types of files that composer brings by default, but that we do not want in the package to deploy.

My proposal would be that artifact-builder would be able to read a .yml file in the root of the project where it is deployed and be able to delete the marked paths. The file could be something like this:

remove:
  - folder1
  - folder2/.*
other-operations:
  - folder3
  - folder4

I think it is more useful a file to manage this than to put it in jenkins, so that at development level it is something fast, does not require to modify anything in jenkins, and it is also marked in the repository of the project.

omarlopesino commented 3 months ago

After a meeting it has been postponed to later as there isn't global consensus about:

jorgetutor commented 3 months ago

Hi omar, I would like to at least support the current parameters as a configuration file.

Now we create the artifact on CI with the proper parameters, sometimes Ci is not available or I want to create an artifact locally but I don't remember the used params like extra folders or git repository, or even worse I copy them wrong by mistake creating a not valid artifact that will be hypothetically released on production. This could be solved creating a make command or bash command but it will be ideal the script supports their own.

Having a drupal.artifact.yaml in the root folder (see example below) will guarantee all artifacts are generated equally, those parameters are not commonly to be changed and we also avoid to additionally configure it on CI

repository: git@example.com:example/example.git
extra-paths:oauth.json,mycustomapp

The script will read first the file to extract the params that could be overridden by command line params if any. What do you think?

omarlopesino commented 3 months ago

@jorgetutor I think it is fine to do it and it solves the questions. It will be useful to save time to do the artifact from the local site, without needing additional documentation / make commands. And it won't produce side effects as it will work as before.