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

feat: add bundle configuration #483

Merged
merged 1 commit into from
Oct 9, 2023
Merged

Conversation

alexpozzi
Copy link
Member

@alexpozzi alexpozzi commented Jun 23, 2023

This PR includes the bundle configuration parser and bootstraps the extension that will automatically create services based on the provided configuration.

The configuration allows to configure one or multiple backends with the following parameters:

snappy:
  backends:
    my_first_backend:
      driver: wkhtmltopdf
      binary_path: /usr/bin/wkhtmltopdf
      timeout: 30
      options:
        my_option_1: my_value_1
        my_option_2: my_value_2
    my_second_backend:
      driver: chromium
      binary_path: /usr/bin/chromium

The above configuration will expose two services named snappy.my_first_backend and snappy.my_second_backend plus (potentially) all their variations for inputs and outputs.

The available parameters are the following:

  • driver: the backend to use, for the moment the supported options are wkhtmltopdf and chromium
  • binary_path: the backend binary path
  • timeout: the timeout in seconds
  • options: a key/value pair of options

Users will also be able to configure multiple backends of the same type, with different configurations.

In case we will like to support other backends that are not binary based we will add another configuration type more suited to them.

Does that work for you?

Note: in this PR I also fixed the CI workflow.

@alexpozzi alexpozzi force-pushed the v2-unstable-bundle-config branch 3 times, most recently from a268750 to df133a0 Compare September 29, 2023 14:32
@alexpozzi alexpozzi marked this pull request as ready for review September 29, 2023 14:34
@alexpozzi alexpozzi force-pushed the v2-unstable-bundle-config branch 3 times, most recently from 4b1f059 to ab72482 Compare September 29, 2023 14:47
set -o pipefail
set -o errexit

(cd /src/Bundle && composer install)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean to use parenthesis around your commands?

Copy link
Member Author

@alexpozzi alexpozzi Oct 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It means that it's scoped and the cd executed inside it does not affect following instructions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok then 👍

src/Bundle/.phpunit.result.cache Outdated Show resolved Hide resolved
@muchafm muchafm self-requested a review October 5, 2023 14:04
@alexpozzi alexpozzi merged commit 9f6a146 into v2-unstable Oct 9, 2023
23 checks passed
@alexpozzi alexpozzi deleted the v2-unstable-bundle-config branch October 9, 2023 09:01
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

Successfully merging this pull request may close these issues.

3 participants