# How to deploy multiple serverless.yml files one after another

**URL:** <https://forum.serverless.com/t/how-to-deploy-multiple-serverless-yml-files-one-after-another/13555>\
**Category:** Serverless Framework\
**Tags:** cloudformation\
**Created:** [January 2, 2021, 12:45pm UTC](https://forum.serverless.com/t/how-to-deploy-multiple-serverless-yml-files-one-after-another/13555 "2021-01-02T12:45:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![karthik](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@karthik](https://forum.serverless.com/u/karthik)\
**Post date:** [January 2, 2021, 12:45pm UTC](https://forum.serverless.com/t/how-to-deploy-multiple-serverless-yml-files-one-after-another/13555/1 "2021-01-02T12:45:45Z")

</div>

I have created multiple Serverless.yml(stacks) files, I am able to deploy one by one using cd with going to each folder, but how to deploy the stacks one after another using a single sevrerless.yml or shell script file?

---

<div class="post-metadata">

**Author:** ![mgleria](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/mgleria/32/4410_2.png) [@mgleria](https://forum.serverless.com/u/mgleria)\
**Post date:** [January 7, 2021, 12:38pm UTC](https://forum.serverless.com/t/how-to-deploy-multiple-serverless-yml-files-one-after-another/13555/2 "2021-01-07T12:38:55Z")

</div>

I think you will have to rely on bash.  
If the stacks are independent, you could execute on parallel doing something like:

`sls deploy -c /path/to/serverless1.yml & sls deploy -c /path/to/serverless2.yml`

If you want instead to execute sequentially (if one fails, the following won’t be executed):

`sls deploy -c /path/to/serverless1.yml && sls deploy -c /path/to/serverless2.yml`

If you have parameters, you could manage them from bash also.

---

<div class="post-metadata">

**Author:** ![ckenney](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@ckenney](https://forum.serverless.com/u/ckenney)\
**Post date:** [February 2, 2021, 4:48pm UTC](https://forum.serverless.com/t/how-to-deploy-multiple-serverless-yml-files-one-after-another/13555/3 "2021-02-02T16:48:37Z")

</div>

bash example… i think i got this from this forum a while back.  
`for dir in _projectfolder/folder-with-all-the-sub-folders/*; do (cd "$dir" && npx serverless deploy); done`
