Skip to content

Enable and disable processes via environment variables #360

@richardcooper

Description

@richardcooper

Feature Request

Allow users to control which process are launched when running process-compose up using environment variables.

Use Case:

I have a project which has a single process-compose.yaml containing all the services used by the project. Different teams members will have a different set of "default" services they want to run 99% of the time. E.g.

  • The frontend dev usually needs to run the website and backend
  • A backend dev needs to run the API site and backend
  • A documentation engineer only needs to run the doc site.

It would be good if users could easily configure their own personal set of enabled/disabled processes without needing to edit or override the process-compose.yaml. The project has a .env file which is not checked into source control, so that seems like a good place to put personalisation.

Proposed Change:

Add two environment variables. One for enabling processes and one for disabling processes. Both are a list of process names.

  • PC_ENABLED_PROCESSES="process1,process2"
  • PC_DISABLED_PROCESSES="process3"

These variables are checked when running process-compose up without any processes defined on the command line. The values from the environment variables override the value of disabled (and is_disabled) from the config file. Any processes not mentioned in an environment variable use the disabled value from the config file as they currently do.

Who Benefits From The Change(s)?

Teams where there are multiple users of the same service-config.yaml who each wants to run a different subset of the processes with a simple process-compose up

Alternative Approaches

Team members could:

  • Always pass process names via the cli. E.g: process-compose up frontend
  • Write their own git-ignored override.yaml files

Metadata

Metadata

Assignees

No one assigned

    Labels

    doneDone, awaiting releaseenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions