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

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

Closed
juanjol opened this issue May 13, 2024 · 7 comments
Closed

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

juanjol opened this issue May 13, 2024 · 7 comments

Comments

@juanjol
Copy link
Contributor

juanjol commented May 13, 2024

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
Copy link
Member

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

  • Is it a priority to have this functionality ASAP?
  • Does this provide value for general Drupal projects or just for very specific ones?
  • Can this functionality produce side effects as the system will allow to exclude files that are needed (for example)?

@jorgetutor
Copy link
Member

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: [email protected]: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
Copy link
Member

@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.

@jonhattan
Copy link
Contributor

I think almost all currently open issues may be fixed with this feature.

@omarlopesino
Copy link
Member

Another issue: #16

@omarlopesino
Copy link
Member

I have been working on this today and now the latest version generates the artifact allowing the usage of a configuration file.

I have documented it at https://github.com/Metadrop/drupal-artifact-builder/?tab=readme-ov-file#configuration

Can you check the documentation is clear? cc @jorgetutor @lpeidro ?

@omarlopesino
Copy link
Member

It has been reviewed and launched at version 2.0.0-alpha1. Closing.

Let's keep in mind this proposal for the other issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants