You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
Details:
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.
The text was updated successfully, but these errors were encountered: