if I have a bunch of serverless projects - each one for a different microserice, then whats the best way to organize them in git ?
I would like to have them all in a services folder in one git project, but this complicates things when I have dev/qa/master branches and for example would like my continuous build to deploy a new version of only one of the services
I was more talking about how to lay out the various serverless projects. If I put all the projects inside one git project then a change to any one of them could cause the whole build process to re-deploy all microservices each time. Just looking for best advice really on how to structure them so that they can still share config but still build/deploy independently, can codepipeline help with any of this?
It sounds like you’re talking about a monorepo. Try googling deploy monorepo independently as the problem you’re trying to solve “which apps inside the monorepo need redeploying after a commit” isn’t a problem specific to Serverless. The solution for other platforms could be applied to Serverless too.
thanks guys, just trying to keep things easy to manage and keep track of for the moment.
I think I’ll just put everything in one repo for the moment and eventually move things out as things take shape. I guess for now I can always add some sort of script with git commands to check for folders that changed and then build/deploy only certain projects accordingly
Serverless keeps cache of deployed service in .serverless folder, so it won’t redeploy it if nothing is changed.
If you’re using circleci or similar, you can keep .serverless directories as an artifacts to speed up the process.
We recently open-sourced tool that we’re using internaly https://github.com/8bites/serviceless to deploy multiple services in parallel.