Is there a way from SST to know when the deploymen...
# seed
d
Is there a way from SST to know when the deployment is a PR or a branch? The reason for that is because we use one AWS account per stage dev / staging / prod Because we cannot use the same hosted zone in multiple accounts, we have our domain.com on prod and then we use staging.domain.com and dev.domain.com That allows for us to use
frontend.<http://STAGE_NAME.domain.com|STAGE_NAME.domain.com>
(Same for developer accounts). When seed deploys a PR it uses the dev access keys and it will use the
pr2
as the stage name . It ends up in an error because it will try to use frontend.pr2.domain.com. Thos hostedzone does not exist. We can’t create it on the fly because it needs to create a NS record on domain.com and we wouldlike to avoid having to share that hosted zone from production environments with development environments. If we could use a suffix and set it to
<http://pr2.dev|pr2.dev>
this will save solve our problem.
f
You can check if the
SEED_PULL_REQUEST_NUMBER
environment variable is set.
Here are more details on build environment variables https://seed.run/docs/adding-a-build-spec.html#build-environment-variables
d
Awesome! I knew it must be possible.
SEED_PULL_REQUEST_NUMBER
and
SEED_STAGE_BRANCH
should do the work!