Platform.sh support
Details:
- Ci name: Platform.sh (don't think they have a formal name for the CI itself, it's simply referred to as "build [process/phase/hook]" in documentation)
- Website: https://platform.sh docs at https://docs.platform.sh
- Default env variables: https://docs.platform.sh/development/variables.html#use-platformsh-provided-variables
Environment variables Vars are listed at https://docs.platform.sh/development/variables.html#use-platformsh-provided-variables
I believe PLATFORM_OUTPUT_DIR might be the variable to check for whether to consider the environment a CI. P.sh reuses the same containers, and that is the only variable that is available in builds only (and not afterwards at runtime).
That said, PLATFORM_TREE_ID is the appropriate variable for a build ID.
You are correct in that PLATFORM_OUTPUT_DIR is one environmental variable that is not available during deploy/runtime but is available during the build stage. The other one is PLATFORM_CACHE_DIR. However, both of these environmental variables are also available during a source operation.
I'm not sure how/if that affects your code. If you need to differentiate between a build stage and a source operation, a source operation stage will have GIT_COMMITTER_NAME, GIT_AUTHOR_NAME, GIT_COMMITTER_EMAIL, and GIT_AUTHOR_EMAIL environmental variables set and available and those are not available in other stages.
You might also include https://community.platform.sh/. It contains numerous community-provided guides/tutorials/how-tos that don't fit into the documentation.