Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,39 @@
# Kamal: Deploy web apps anywhere
# Kamal with support for depot.dev builders

This is an actively maintained fork of [basecamp/kamal](https://github.com/basecamp/kamal) that's kept in sync with support for [depot.dev](https://depot.dev) builders.

```
The main branch is currently in sync with version 2.10.1
```

## Installation with depot builder support

Run the following commands to use `kamal` from this repository:

```sh
gem install specific_install && gem specific_install https://github.com/navinpeiris/kamal-depot.git
```

## Building with depot builders

Set the `depot` option under `builder` to `true`, and optionally specify the platforms to build for under `arch`.

```yaml
builder:
depot: true
arch:
- amd64
- arm64
```

## Rebasing with basecamp/kamal

```sh
git fetch upstream
git rebase vX.X.X
```

## Kamal: Deploy web apps anywhere

From bare metal to cloud VMs, deploy web apps anywhere with zero downtime. Kamal uses [kamal-proxy](https://github.com/basecamp/kamal-proxy) to seamlessly switch requests between containers. Works seamlessly across multiple servers, using SSHKit to execute commands. Originally built for Rails apps, Kamal will work with any type of web app that can be containerized with Docker.

Expand Down
10 changes: 8 additions & 2 deletions lib/kamal/commands/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Kamal::Commands::Builder < Kamal::Commands::Base
to: :target

delegate \
:local?, :remote?, :pack?, :cloud?,
:local?, :remote?, :pack?, :cloud?, :depot?,
to: "config.builder"

include Clone
Expand All @@ -17,7 +17,9 @@ def name
end

def target
if remote?
if depot?
depot
elsif remote?
if local?
hybrid
else
Expand All @@ -32,6 +34,10 @@ def target
end
end

def depot
@depot ||= Kamal::Commands::Builder::Depot.new(config)
end

def remote
@remote ||= Kamal::Commands::Builder::Remote.new(config)
end
Expand Down
21 changes: 21 additions & 0 deletions lib/kamal/commands/builder/depot.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class Kamal::Commands::Builder::Depot < Kamal::Commands::Builder::Base
def push(export_action = "registry", tag_as_dirty: false, no_cache: false)
depot :build,
"--output=type=#{export_action}",
*platform_options(arches),
*build_tag_options(tag_as_dirty: tag_as_dirty),
*build_options,
*([ "--no-cache" ] if no_cache),
build_context,
"2>&1"
end

def inspect_builder
# No-op
end

private
def depot(*args)
args.compact.unshift :depot
end
end
4 changes: 4 additions & 0 deletions lib/kamal/configuration/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def remote_arches
end
end

def depot?
builder_config["depot"] == true
end

def remote?
remote_arches.any?
end
Expand Down
6 changes: 6 additions & 0 deletions lib/kamal/configuration/docs/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
#
# Options go under the builder key in the root configuration.
builder:
# Use depot.dev for builds
#
# If true, Kamal will use depot.dev for builds.
#
# Defaults to false:
depot: false

# Arch
#
Expand Down