- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 301
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
[WIP] Kamal deployment #1192
Draft
yinho999
wants to merge
28
commits into
loco-rs:master
Choose a base branch
from
yinho999:kamal-deployment
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,581
−196
Draft
[WIP] Kamal deployment #1192
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
f8b6f48
feat: add Kamal deployment support
yinho999 bcd0f87
Merge branch 'master' into kamal-deployment
yinho999 fbb3502
Merge branch 'master' into kamal-deployment
yinho999 e6bdeb0
Added test for postgres, sqlite without/with background queue with redis
yinho999 af50d5f
Added binding 0.0.0.0 to development.yaml
yinho999 328ccae
removed duplicated dockerfile
yinho999 60fca18
Merge branch 'master' into kamal-deployment
yinho999 db6cdfd
feat: add .dockerignore and improve deployment file generation
yinho999 04a1c4c
style: reorganize imports across multiple files
yinho999 a75bd59
style: reformat doc comments and reorganize imports
yinho999 2ec6d2a
feat: backup existing deployment files before generation
yinho999 e04c8b5
feat: add default development.yaml config to deployment tests
yinho999 efbd6cc
Merge branch 'master' into kamal-deployment
yinho999 e124196
style: improve code formatting and readability
yinho999 b974128
refactor: extract scaffold kind determination into separate function
yinho999 8b3c713
feat: add Kamal deployment support
yinho999 c35d27f
Merge branch 'master' into kamal-deployment
yinho999 5852120
refactor: update server binding configuration in deployment templates
yinho999 2604d33
Merge remote-tracking branch 'origin/kamal-deployment' into kamal-dep…
yinho999 52240c7
Merge branch 'master' into kamal-deployment
yinho999 0f98eb6
Merge branch 'master' into kamal-deployment
yinho999 c9bb3e6
refactor: restructure Kamal deployment configuration and improve code…
yinho999 f87081d
style: improve code formatting and organization
yinho999 6b9ead9
test: add Kamal deployment generation test
yinho999 d2767af
style: improve code organization and line wrapping
yinho999 c6fb232
fix: update Kamal secrets directory path to use dot prefix
yinho999 64f02e7
feat: add Kamal deployment support for Rails applications
yinho999 8eb8897
Merge branch 'master' into kamal-deployment
yinho999 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added binding 0.0.0.0 to development.yaml
commit af50d5ff64dfa46585c559af4918176475a93f67
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
.../templates/snapshots/generate[kamal_secrets_sqlite_with_background_queue]@deployment.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
source: loco-gen/tests/templates/deployment.rs | ||
expression: "fs::read_to_string(tree_fs.root.join(\".kamal\").join(\"secrets\")).expect(\"secrets file missing\")" | ||
--- | ||
# Secrets defined here are available for reference under registry/password, env/secret, builder/secrets, | ||
# and accessories/*/env/secret in config/deploy.yml. All secrets should be pulled from either | ||
# password manager, ENV, or a file. DO NOT ENTER RAW CREDENTIALS HERE! This file needs to be safe for git. | ||
|
||
# Option 1: Read secrets from the environment | ||
KAMAL_REGISTRY_PASSWORD=$KAMAL_REGISTRY_PASSWORD | ||
|
||
# Option 2: Read secrets via a command | ||
# RAILS_MASTER_KEY=$(cat config/master.key) | ||
|
||
# Option 3: Read secrets via kamal secrets helpers | ||
# These will handle logging in and fetching the secrets in as few calls as possible | ||
# There are adapters for 1Password, LastPass + Bitwarden | ||
# | ||
# SECRETS=$(kamal secrets fetch --adapter 1password --account my-account --from MyVault/MyItem KAMAL_REGISTRY_PASSWORD RAILS_MASTER_KEY) | ||
# KAMAL_REGISTRY_PASSWORD=$(kamal secrets extract KAMAL_REGISTRY_PASSWORD $SECRETS) | ||
# RAILS_MASTER_KEY=$(kamal secrets extract RAILS_MASTER_KEY $SECRETS) |
12 changes: 12 additions & 0 deletions
12
loco-gen/tests/templates/snapshots/inject[development.yaml]@deployment.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
source: loco-gen/tests/templates/deployment.rs | ||
expression: "fs::read_to_string(tree_fs.root.join(\"config\").join(\"development.yaml\")).expect(\"development.yaml missing\")" | ||
--- | ||
# Web server configuration | ||
server: | ||
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT} | ||
port: 5150 | ||
# Expose Server on all interfaces | ||
binding: 0.0.0.0 | ||
# The UI hostname or IP address that mailers will point to. | ||
host: http://localhost |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we not using the same docker template that we already have?
I don't think we need to hold two docker templates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current docker template has a different purpose than the one kamal one. As I can see the current
dockerfile
does not include sea orm and seems to be just compiling the binaries without running it. Not sure if I merge them or leave them separated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question is, why should SeaORM be included in this docker file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are using
sea-orm-cli
for generating entities. Why would you need to generate entities inside the Dockerfile?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My current dockerfile for kamal setup is serving the server within the container instead of just compiling, which requires database connection like sqlite or postgres. Therefore SeaOrm is kinda required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait sea orm cli is not required for database connection? Okay I will remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if you can use the current docker file and not create a new one