https://serverless-stack.com/ logo
#help
Title
# help
k

Kuda Zhou

03/25/2022, 9:22 AM
@Frank is it possible to use multiple sst.json files in one repo? Essentially i want to create another json file called sst-ci-cd.json with the aim of separating out the index.js file for our CI-CD stack and the app stack which live under the same repo. We don’t want to trigger the app to be updated via cloudformation when we add or delete new pipelines. Hope that makes sense
{
“name”: “sst-demo”, “region”: “eu-west-2", “main”: “stacks/index.ts” } the also have the pipeline one`{`
"name": "sst-demo",
"region": "eu-west-2",
"main": "ci-cd-stacks/index.ts"
}
j

jamlen

03/25/2022, 11:44 AM
Or to be able to override the path for
main
? so from the CLI can we do something like
yarn sst deploy --main 'ci-cd-stacks/index.ts' --stage ci
t

thdxr

03/25/2022, 3:57 PM
we don't support this currently but we generally don't recommend using checked in files to handle variations in deploy
You should have the logic inside
stacks/index.ts
and do something different depending on the stage or some env variable
You can have multiple sst apps in the same repo but the need to be in different folders
f

Frank

03/25/2022, 6:20 PM
@Kuda Zhou just to clarify, would it work for u if the two json files are in different folders?
k

Kuda Zhou

03/25/2022, 6:25 PM
Well in one folder but named differently and if in two different folders how do we handle that?
f

Frank

03/25/2022, 6:56 PM
It’s not something I thought thru/recommend, but u could have something like this:
Copy code
/
  backend/
    sst.json
  pipeline/
    sst.json
k

Kuda Zhou

03/25/2022, 6:58 PM
Ok I'll give that a go and see how it behaves. That way the pipeline should only deploy the stacks we target in the deploy command
4 Views