Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: add public deployment of LinearLite #1929

Merged
merged 38 commits into from
Nov 15, 2024
Merged

Conversation

balegas
Copy link
Contributor

@balegas balegas commented Nov 5, 2024

Took changes from #1915 on top of main

Copy link

netlify bot commented Nov 5, 2024

Deploy Preview for electric-next ready!

Name Link
🔨 Latest commit 8df6331
🔍 Latest deploy log https://app.netlify.com/sites/electric-next/deploys/67378a8de3a7b10008404d3f
😎 Deploy Preview https://deploy-preview-1929--electric-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@KyleAMathews KyleAMathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@icehaunter icehaunter changed the title (cherry pick) examples: add public deployment of LinearLite examples: add public deployment of LinearLite Nov 5, 2024
@balegas balegas force-pushed the balegas/sst-linearlite branch from aa5bbf6 to dce24ba Compare November 6, 2024 13:27

- name: Initialize SST environment
run: |
sudo apt install -y tini
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tini stuff was an experiment I did to see if it'd help sst gracefully shut down (i.e. save it's state correctly when github actions kills it). It didn't seem to work actually so what is needed is concurrency controls so only one action can run at a time & running ones don't get killed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually looking at the deploy logs — it's already gotten into a bad state because of github killing an action. The "resource already exists" error happens when SST creates a resource but doesn't save it in its state file before getting killed. The only solution is to manually go into aws and remove the resource and try the deploy again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. I am trying to figure this out. I thought it could be something I've done locally.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha yeah — i've spent a lot of time sorting through this error — you just gotta click around AWS' console looking for the resource(s) mentioned and delete them manually.

Then at the top of file you want:

concurrency:
  group: prod-deploy-group

Copy link
Contributor

@KyleAMathews KyleAMathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! Excited to see examples go live!

Another nice feature in the future would be posting comments w/ URLs to the sites — there's a good example here: https://github.com/taylorfsteele/TSS/blob/920d33974685280743fce243043099f3d45a4261/.github/workflows/pull-request.yml#L125C2-L168C14

run: |
export PR_NUMBER=${{ github.event.number }}
echo "Removing stage pr-$PR_NUMBER"
pnpm sst remove --stage "pr-$PR_NUMBER"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use $DEPLOY_ENV here to be consistent with other workflow?

return $interpolate`postgresql://${passwordOutput.roleName}:${passwordOutput.password}@${project.databaseHost}/${db.name}?sslmode=require`
}

async function addDatabaseToElectric(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine for now but in a future PR moving all these common helper functions into a common lib would be good

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be using hono client!

Copy link
Contributor

@KyleAMathews KyleAMathews merged commit 032a71d into main Nov 15, 2024
17 of 18 checks passed
@KyleAMathews KyleAMathews deleted the balegas/sst-linearlite branch November 15, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants