SAP / cloud-mta

Built-in tools to work with Multi-Target-Application (MTA) projects
Apache License 2.0
22 stars 10 forks source link

I would like a way to disable a module #185

Closed obarat closed 3 years ago

obarat commented 3 years ago

Resources have a toggle active that works really well in case the space you are deploying to doesn't support that resource. I would like a way to easily toggle off a module so that it doesn't get deployed.

ddonchev commented 3 years ago

Hi Omid, It's not declarative, but for CF deployments you can use partial deploy cli options to achieve this behaviour: https://github.com/SAP-samples/cf-mta-examples/tree/master/partial-build-deploy#usage e.g. cf deploy <archive> -m <module-name-to-be-included> -m <...> --all-resources Point taken that having this feature configurable via an extension descriptor would make sense for your case. BR,

katunin-ng commented 3 years ago

Hi Omid,

Please consider an option of using "supported-platforms" build parameter option: https://sap.github.io/cloud-mta-build-tool/configuration/#configuring-and-packaging-modules-according-to-target-platforms If you set the empty brackets value (below) the module will be excluded from the result MTA archive during the build. build-parameters: supported-platforms: [] Also, you can control if include/not include the certain module in the specific build by passing this configuration via mta extension file, i.e. you maintain dedicated mta extension file per scenario.

Regards Natalia

obarat commented 3 years ago

@katunin-ng - thanks for the suggestion, I am trying to do that but can't figure it out. Is this what you mean?

mta.yaml


modules:
 - name: x

my_env.mtaext


modules:
 - name: x
    build-parameters:
      supported-platforms: [] 
michawai commented 3 years ago

@obarat , looks ok 👍