kwicherbelliaken / bad-reviews-make-good-movies

0 stars 0 forks source link

[FEATURE]: deploy to production #97

Closed slackermorris closed 5 months ago

slackermorris commented 6 months ago

What else do I need to do to be production ready? I think having a CI/CD pipeline set up would be hugely beneficial.

Testing is good. Features can be added.

Maybe it is best to deploy to production and buy a domain?

slackermorris commented 6 months ago

Here is a resource from Github: https://github.blog/2022-02-02-build-ci-cd-pipeline-github-actions-four-steps/

slackermorris commented 6 months ago

I need to set up CI/CD pipeline for deploying my SST Stack.

slackermorris commented 6 months ago

I need to rename the stage. staging is essentially called slackermorris.

slackermorris commented 6 months ago

I wonder where the envs are stored? I think I really need to read this document to better understand the full stack experience: https://docs.sst.dev/constructs/StaticSite#environment-variables

slackermorris commented 6 months ago
  1. Deploy the Stack.
  2. Create a PR.
  3. Merge against master.

I suppose another thing to be done is to point routing to my application and buy a domain.

slackermorris commented 6 months ago

OK. Sort of unrelated. But I requested a new domain for badreviewsmakegoodmovies.

Screen Shot 2024-02-18 at 11 42 03 AM

Seems like I need to renew ownership of my other domain.

slackermorris commented 6 months ago

I have made a request for the domain.

Screen Shot 2024-03-01 at 8 54 51 AM
slackermorris commented 6 months ago

OK. Now I am trying to make use of this domain. I am reading the source here: https://sst.dev/chapters/custom-domains-in-serverless-apis.html

slackermorris commented 6 months ago

This is helpful to see what the config actually looks like: https://github.com/sst/sst/issues/3139

slackermorris commented 6 months ago

I am in a bit of bind. I thought I deleted all the CloudFormation Resources but it doesn't seem like it. And now I am stuck with some weird UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS error.

slackermorris commented 6 months ago

I triggered a deletion from the AWS Console.

slackermorris commented 6 months ago

I need to delete all the prod not production Stacks. They were misdeployed.

slackermorris commented 6 months ago

Cool. I am deploying and then I will have to update the endpoints in the client app. It seems like the Site Stack is hanging. I think I have hit this before.

I think I will let it run for a while longer and if nothing happens then I'll trigger a deploy.

slackermorris commented 6 months ago

Whoops. Wasn't meant to do that. Lol.

Screen Shot 2024-03-08 at 10 49 37 AM
slackermorris commented 6 months ago

I am deleting the production Site Stack from CLI.

Screen Shot 2024-03-08 at 10 51 04 AM

I wonder if there is a step in particular that it is hanging on?

slackermorris commented 6 months ago
Screen Shot 2024-03-08 at 10 52 45 AM Screen Shot 2024-03-08 at 10 53 05 AM
slackermorris commented 6 months ago

This might be what I am after.

Screen Shot 2024-03-08 at 10 56 22 AM
slackermorris commented 6 months ago

This might be entirely unrelated.

Found here.

Screen Shot 2024-03-08 at 11 05 15 AM
slackermorris commented 6 months ago

I mean, I feel like I have things set up correctly.

Screen Shot 2024-03-08 at 11 51 15 AM
slackermorris commented 6 months ago
Screen Shot 2024-03-08 at 11 55 30 AM
slackermorris commented 6 months ago

I triggered deletion via the AWS Console again. I will then try to deploy it.

slackermorris commented 6 months ago

Here is a bit more information.

Screen Shot 2024-03-08 at 12 10 47 PM
slackermorris commented 6 months ago

So, looking at the log groups for the different lambdas. I can find a certificate lambda that seems to have a log entry for the deployment period.

It looks like it depends on aws-sdk and I don't have this as a explicit dependency of my project.

Screen Shot 2024-03-08 at 12 14 37 PM

Though sst does seem to "bring it in".

Screen Shot 2024-03-08 at 12 16 28 PM
slackermorris commented 6 months ago

I am trying to see if I get the same issue when deploying to my development stage. If it shits itself then I will add aws-sdk as a dep.

So, deploying to development worked fine.

slackermorris commented 6 months ago

I am trying to delete the production Stack once more.

slackermorris commented 6 months ago

In the meantime, maybe it is a good idea to have an alias for the development | staging API?

slackermorris commented 6 months ago

There is something buggy about this, because this is the only difference between production and staging.

Screen Shot 2024-03-10 at 10 06 02 AM

Remember that the ApiStack deployed just fine.

Maybe I remove that code and see if I can deploy.

I am trying to deploy to production without the domainAlias mentioned. I think I am still running into the same issue. It looks like it is hanging here.

Screen Shot 2024-03-10 at 2 57 02 PM
slackermorris commented 6 months ago

This is the problematic lambda.

slackermorris commented 6 months ago

I am really not sure if it is as simple as this, but it might be. A lot of my application code lambdas are deployed with a relevant package.json nearby.

image

It begs the question: why does staging deploy just fine?

slackermorris commented 6 months ago

This looks like the difference in deployed lambdas between the environments.

image

slackermorris commented 6 months ago

Let's see what happens if I specify the domain for staging as well.

slackermorris commented 5 months ago

I bumped SST dep as per the recommendation in Discord.

Screen Shot 2024-03-21 at 8 01 32 AM Screen Shot 2024-03-21 at 8 01 06 AM

Maybe I didn't bump high enough?

It's still hanging.

slackermorris commented 5 months ago

It's still hanging here.

Screen Shot 2024-03-21 at 8 03 13 AM
slackermorris commented 5 months ago

Just upgraded to the latest version of sst which includes bumps in dependencies.

Screen Shot 2024-03-21 at 8 05 30 AM Screen Shot 2024-03-21 at 8 05 17 AM
slackermorris commented 5 months ago

I tried to re-run the production deployment but I've run up against the same thing:

Screen Shot 2024-03-21 at 8 09 34 AM

I guess I have to wait until CloudFormation stops the whole process, etc.

slackermorris commented 5 months ago

I started a delete from the AWS Console.

Screen Shot 2024-03-21 at 8 10 53 AM
slackermorris commented 5 months ago

Alright giving it another go with updated dependencies. It seems like it is hanging in the same place.

Screen Shot 2024-03-22 at 10 05 49 AM
slackermorris commented 5 months ago

There might be a little bit of movement.

Screen Shot 2024-03-22 at 10 07 12 AM

It fucking worked. Holy shit.

Screen Shot 2024-03-22 at 10 07 45 AM
slackermorris commented 5 months ago

I can probably merge all the stacks now.