Automated webiny deployment with AWS Codepipeline

Hi,

I’m thinking from a long time how can I make the Webiny deployments automated. I want to keep Webiny deployment state in the cloud rather than on my laptop so here’s the idea that came to my mind:

  • Let’s deploy Webiny using Docker image
  • This image can sit in AWS Elastic Container Registry
  • Using AWS Codebuild and mentioned image execute webiny deploy
  • The state of the image will change so let’s save it to the ECR as a new version
  • We can also keep config files on Github and apply them during build with Codebuild

I made a basic graph that shows this concept built with AWS Codepipeline.

Hey, Webiny developers! Do you think it’s worth to try to build Webiny deployment pipeline like that or I shoild change something?

Thanks @Peter_Palka, we’ll definitely take a look at this!

Regarding state storage, we were thinking about using S3 bucket, that way you can also share your state with other team members. Have a look at this issue, and this comment in particular: https://github.com/webiny/webiny-js/issues/633#issuecomment-562548944

Let us know what you think.

Cheers!

Just got a quick glance at the diagram. This looks like a process that would be suitable if Webiny was built for containers, but we can’t deploy Webiny to containers at all. Maybe I’m missing something here?

We use serverless components and deploy stuff directly to AWS using their SDK. So it’s Lambda, API Gateway, Cloudfront and S3.

If there was a way to deploy using containers, it would be an added bonus, but our primary focus is serverless and I personally don’t see how we can pack Webiny to run in containers :thinking:

Hi Pavel,

I think my graph is not clear. I will try to fix it later.

The thing is I need to use my laptop to run for example webiny deploy-api. The state of the Webiny is saved on my laptop. I want to put my “laptop” into Docker image.

I want to close webiny state in Docker image.

Edit: in the discussion under the link you mentioned earlier you’re basically solving my problem. I was trying to save the webiny state in Docker image. I see your solution needs more additional development but it’s much more lightweight. Thanks for pointing it out!

Ah ok, thanks for clarification. We DO want to make this mechanism to be built-in with our CLI, but we seriously lack man power. We’re now in the process of hiring a few more developers, hopefully this issue will get the attention it deserves.

Also, we’re still waiting to receive a definitive response from the Serverless Framework team about their next steps, as we know they are seriously changing the way components are deployed and how they handle state.

Anyhow, we hope this problem will be resolved this year (can’t be any more precise, sorry). I’ll keep you updated.

Cheers!

Thanks for the update, mate. As your solution looks much simplier and solves my problem I will keep my eyes open for new releases.

Cheers!