Nick Laffey
11/16/2021, 9:58 PM--port
flag on sst start
was removed. Was that intentional? Is there any new way to specify the port being used?Frank
sst start
would automatically search for an open port if the default port 12557 is in-use, since the port wasn’t user facing.Frank
Nick Laffey
11/16/2021, 10:03 PMNick Laffey
11/16/2021, 10:04 PMNick Laffey
11/16/2021, 10:04 PMFrank
ILSST
(I Love SST), and made a typo in the spelling 😅Nick Laffey
11/16/2021, 10:07 PMFrank
Nick Laffey
11/16/2021, 10:08 PMNick Laffey
11/16/2021, 10:08 PMFrank
Nick Laffey
11/16/2021, 10:09 PMFrank
sst start
is fired up?Frank
Nick Laffey
11/16/2021, 10:12 PM"sst:start": "sst start --stage $(aws iam get-user --query 'User.UserName' --output text) --port 12557",
"sst:env": "wait-on tcp:12557 && sst-env -- craco start",
"start": "rushx rm-cdk-context && concurrently -k -r \"rushx codegen --watch\" \"rushx schema:watch\" \"rushx deps:watch\" \"rushx sst:start\" \"rushx sst:env\"",
Nick Laffey
11/16/2021, 10:13 PMFrank
thdxr
11/16/2021, 10:17 PMFrank
sst start
is up and running?Frank
I thought we still supported --portI took out
--port
in v0.52.0 and added auto port searching 😔Frank
Patrick Young
11/16/2021, 10:26 PMPatrick Young
11/16/2021, 10:27 PMPatrick Young
11/16/2021, 10:27 PMNick Laffey
11/16/2021, 10:28 PMPatrick Young
11/16/2021, 10:30 PMFrank
sst-env
cli to work and provide the REACT_APP_* environment variables right?Nick Laffey
11/16/2021, 10:45 PMsst start
2. It generates our backend API url and userpool information which we write into SSM
3. We run our frontend start
script which pulls in the backend values via SSM and pushes them into the ReactStaticSite
4. Once we know the ReactStaticSite is deployed (by waiting on the port) we start up our create-react-app now that the environment variables are populated.Nick Laffey
11/16/2021, 10:54 PMFrank
sst-env
work with sst deploy
, would this work for you:
"sst:deploy": "sst deploy --stage $(aws iam get-user --query 'User.UserName' --output text)",
"sst:env": "sst-env -- craco start",
"start": "rushx rm-cdk-context && concurrently -k -r \"rushx codegen --watch\" \"rushx schema:watch\" \"rushx deps:watch\" \"rushx sst:deploy\" && rushx sst:env",
Frank
sst deploy
instead of sst start
. And you don’t have to wait on the port, you just have to wait for the command to finish deploying and quit. Then you can run sst-env -- craco start
to start up CRA.Patrick Young
11/16/2021, 11:04 PMNick Laffey
11/16/2021, 11:04 PMNick Laffey
11/16/2021, 11:05 PMsst-env
just grabs values from the sst .build folder and injects them into the environment variables for CRANick Laffey
11/16/2021, 11:06 PMFrank
I’m trying to understand if we lose anything by deploying rather than starting…If you are not live debugging the Lambda functions, you don’t lose anything.
Nick Laffey
11/16/2021, 11:07 PMFrank
I’m wondering if I can “short circuit” it and have a script that gets the environment variables without a full deploy?We added an optimization in v0.50.0. If there are no changes in the stack, it’s going to deploy real quick.
Nick Laffey
11/16/2021, 11:08 PMFrank
sst deploy
to support sst-env
. And you guys can give it a try.Frank
--port
option back.Frank
sst deploy
to finish is less hackier than waiting for port.Patrick Young
11/16/2021, 11:23 PMPatrick Young
11/16/2021, 11:24 PMPatrick Young
11/16/2021, 11:26 PMNick Laffey
11/16/2021, 11:50 PMsst deploy
exits after it’s done and deployed so we don’t need to do a wait-on
.Nick Laffey
11/16/2021, 11:51 PMsst start
which never exits so we have no direct output telling us it’s complete.Patrick Young
11/17/2021, 12:27 AMthdxr
11/17/2021, 12:49 AMthdxr
11/17/2021, 12:50 AMPatrick Young
11/17/2021, 1:01 AMPatrick Young
11/17/2021, 1:15 AM"sst:start": "sst start --stage $(aws iam get-user --query 'User.UserName' --output text)",
"rm-cdk-context": "rm -f ./cdk.context.json ./.build/static-site-environment-output-values.json",
"sst:env": "wait-on ./.build/static-site-environment-output-values.json && sst-env -- craco start",
"start": "rushx rm-cdk-context && concurrently -k -r \"rushx codegen --watch\" \"rushx schema:watch\" \"rushx deps:watch\" \"rushx sst:start\" \"rushx sst:env\"",
This fixes the issue 🤷 . Still kind of gross... So @Frank if you think you can make it cleaner and its worthwhile go for it otherwise we are unblocked for now.Patrick Young
11/17/2021, 1:15 AMFrank
Sean Matheson
11/17/2021, 7:36 AM--port
to come back.Sean Matheson
11/17/2021, 8:32 AMSean Matheson
11/17/2021, 8:35 AMsst start
command, with the ability to configure/delegate to an associated script for the frontend(s). The real kicker would be automatic restart of the frontend process(es) if and when the environment variables change. Feels much more get up and go sort of vibe.thdxr
11/17/2021, 2:04 PMthdxr
11/17/2021, 2:05 PMthdxr
11/17/2021, 2:06 PMFrank
--port
flag would still be required.thdxr
11/17/2021, 9:25 PMthdxr
11/17/2021, 9:25 PM