Can I pass user-defined variables on startup to NPL/platform?

Is there a way I can pass user defined variables to the platform / into NPL code on startup? (I’m thinking of environment variables)

Other than in the migration descriptor file under npl-run or run-only e.g.

  - npl-run:
    protocol: Seed
    action: init
    arguments: true
    run-only: local, dev

A use case would be that you have some value that represents a long expiration period, for example, and you want this to be some value in PROD but a much shorter value in other environments so it’s easier to test.

Hi Stuart,

This is currently not supported. A possible work-around would be to have two similar entries in your migration descriptor, one for prod and one for non-prod, with different arguments.

Something like:

- npl-run:
  protocol: Seed
  action: init
  arguments: [1]
  run-only: [local, dev]

- npl-run:
  protocol: Seed
  action: init
  arguments: [1000000000]
  run-only: [prod]

Can it be considered as a feature for a future release?

It would really help with testing.