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

[WIP] Kamal deployment #1192

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft
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 Jan 19, 2025
bcd0f87
Merge branch 'master' into kamal-deployment
yinho999 Jan 19, 2025
fbb3502
Merge branch 'master' into kamal-deployment
yinho999 Jan 19, 2025
e6bdeb0
Added test for postgres, sqlite without/with background queue with redis
yinho999 Jan 19, 2025
af50d5f
Added binding 0.0.0.0 to development.yaml
yinho999 Jan 19, 2025
328ccae
removed duplicated dockerfile
yinho999 Jan 20, 2025
60fca18
Merge branch 'master' into kamal-deployment
yinho999 Jan 25, 2025
db6cdfd
feat: add .dockerignore and improve deployment file generation
yinho999 Jan 25, 2025
04a1c4c
style: reorganize imports across multiple files
yinho999 Jan 25, 2025
a75bd59
style: reformat doc comments and reorganize imports
yinho999 Jan 25, 2025
2ec6d2a
feat: backup existing deployment files before generation
yinho999 Jan 26, 2025
e04c8b5
feat: add default development.yaml config to deployment tests
yinho999 Jan 26, 2025
efbd6cc
Merge branch 'master' into kamal-deployment
yinho999 Jan 26, 2025
e124196
style: improve code formatting and readability
yinho999 Jan 26, 2025
b974128
refactor: extract scaffold kind determination into separate function
yinho999 Jan 26, 2025
8b3c713
feat: add Kamal deployment support
yinho999 Jan 26, 2025
c35d27f
Merge branch 'master' into kamal-deployment
yinho999 Jan 26, 2025
5852120
refactor: update server binding configuration in deployment templates
yinho999 Jan 26, 2025
2604d33
Merge remote-tracking branch 'origin/kamal-deployment' into kamal-dep…
yinho999 Jan 26, 2025
52240c7
Merge branch 'master' into kamal-deployment
yinho999 Jan 27, 2025
0f98eb6
Merge branch 'master' into kamal-deployment
yinho999 Feb 1, 2025
c9bb3e6
refactor: restructure Kamal deployment configuration and improve code…
yinho999 Feb 1, 2025
f87081d
style: improve code formatting and organization
yinho999 Feb 1, 2025
6b9ead9
test: add Kamal deployment generation test
yinho999 Feb 1, 2025
d2767af
style: improve code organization and line wrapping
yinho999 Feb 1, 2025
c6fb232
fix: update Kamal secrets directory path to use dot prefix
yinho999 Feb 2, 2025
64f02e7
feat: add Kamal deployment support for Rails applications
yinho999 Feb 2, 2025
8eb8897
Merge branch 'master' into kamal-deployment
yinho999 Feb 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor: update server binding configuration in deployment templates
yinho999 committed Jan 26, 2025
commit 58521208719d46426686bc6c64c31acc2468647d
8 changes: 6 additions & 2 deletions loco-gen/src/templates/deployment/docker/docker.t
Original file line number Diff line number Diff line change
@@ -4,8 +4,12 @@ message: "Dockerfile generated successfully."

injections:
- into: config/development.yaml
after: " port: 5150"
content: " # Expose Server on all interfaces\n binding: 0.0.0.0"
remove_lines: |
# Binding for the server (which interface to bind to)
binding: {{ get_env(name="BINDING", default="localhost") }}
content: |
| # Binding for the server (which interface to bind to)
| binding: {{ get_env(name="BINDING", default="0.0.0.0") }}

---

40 changes: 10 additions & 30 deletions loco-gen/tests/templates/deployment.rs
Original file line number Diff line number Diff line change
@@ -29,12 +29,8 @@ fn can_generate_docker(
.drop(true)
.add(
"config/development.yaml",
r#"# Web server configuration
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: 5150
# The UI hostname or IP address that mailers will point to.
host: http://localhost
r#" # Binding for the server (which interface to bind to)
binding: {{ get_env(name="BINDING", default="localhost") }}
"#,
)
.create()
@@ -214,12 +210,8 @@ fn can_generate_kamal_sqlite_without_background_queue() {
.drop(true)
.add(
"config/development.yaml",
r#"# Web server configuration
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: 5150
# The UI hostname or IP address that mailers will point to.
host: http://localhost
r#" # Binding for the server (which interface to bind to)
binding: {{ get_env(name="BINDING", default="localhost") }}
"#,
)
.create()
@@ -299,12 +291,8 @@ fn can_generate_kamal_sqlite_with_background_queue() {
.drop(true)
.add(
"config/development.yaml",
r#"# Web server configuration
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: 5150
# The UI hostname or IP address that mailers will point to.
host: http://localhost
r#" # Binding for the server (which interface to bind to)
binding: {{ get_env(name="BINDING", default="localhost") }}
"#,
)
.create()
@@ -382,12 +370,8 @@ fn can_generate_kamal_postgres_without_background_queue() {
.drop(true)
.add(
"config/development.yaml",
r#"# Web server configuration
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: 5150
# The UI hostname or IP address that mailers will point to.
host: http://localhost
r#" # Binding for the server (which interface to bind to)
binding: {{ get_env(name="BINDING", default="localhost") }}
"#,
)
.create()
@@ -465,12 +449,8 @@ fn can_generate_kamal_postgres_with_background_queue() {
.drop(true)
.add(
"config/development.yaml",
r#"# Web server configuration
server:
# Port on which the server will listen. the server binding is 0.0.0.0:{PORT}
port: 5150
# The UI hostname or IP address that mailers will point to.
host: http://localhost
r#" # Binding for the server (which interface to bind to)
binding: {{ get_env(name="BINDING", default="localhost") }}
"#,
)
.create()
Original file line number Diff line number Diff line change
@@ -2,11 +2,5 @@
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
# Binding for the server (which interface to bind to)
binding: {{ get_env(name="BINDING", default="localhost") }}