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
This adds three labels `pull-request`, `branch` and `subdomain` to the
preview container.
In this way we can inspect the labels to obtain these informations back
using:
```
docker inspect --format '{{ index .Config.Labels "pull-request" }}'
container_id
docker inspect --format '{{ index .Config.Labels "branch" }}'
container_id
docker inspect --format '{{ index .Config.Labels "subdomain" }}'
container_id
```
Note: to get the PR number I used the `$CIRCLE_PULL_REQUEST` that
contains the URL of the associated pull request and the bash's built-in
parameter substitution `${var##Pattern}`. The way this works is by
removing a prefix that greedily matches `*/`, which is what the `##`
operator does.
0 commit comments