Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d141c82efa | ||
|
|
cdb6c014ac | ||
|
|
7ded6d3aef | ||
|
|
2ea60bea5e | ||
|
|
3948a95e7a | ||
|
|
21d7d6d79c | ||
|
|
f1b3c4a4fb | ||
|
|
fd9564f0c8 | ||
|
|
d2338251a9 | ||
|
|
b00a4ec3e2 | ||
|
|
4b09375ccd | ||
|
|
3e0302230e | ||
|
|
bce2d35e9f |
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -3,7 +3,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- 1-8-stable
|
- 1-9-stable
|
||||||
pull_request:
|
pull_request:
|
||||||
jobs:
|
jobs:
|
||||||
rubocop:
|
rubocop:
|
||||||
@@ -31,6 +31,9 @@ jobs:
|
|||||||
gemfile:
|
gemfile:
|
||||||
- Gemfile
|
- Gemfile
|
||||||
- gemfiles/rails_edge.gemfile
|
- gemfiles/rails_edge.gemfile
|
||||||
|
exclude:
|
||||||
|
- ruby-version: "3.1"
|
||||||
|
gemfile: gemfiles/rails_edge.gemfile
|
||||||
name: ${{ format('Tests (Ruby {0})', matrix.ruby-version) }}
|
name: ${{ format('Tests (Ruby {0})', matrix.ruby-version) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|||||||
1
.github/workflows/docker-publish.yml
vendored
1
.github/workflows/docker-publish.yml
vendored
@@ -51,5 +51,4 @@ jobs:
|
|||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/basecamp/kamal:latest
|
|
||||||
ghcr.io/basecamp/kamal:${{ steps.version-tag.outputs.value }}
|
ghcr.io/basecamp/kamal:${{ steps.version-tag.outputs.value }}
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ WORKDIR /workdir
|
|||||||
|
|
||||||
# Tell git it's safe to access /workdir/.git even if
|
# Tell git it's safe to access /workdir/.git even if
|
||||||
# the directory is owned by a different user
|
# the directory is owned by a different user
|
||||||
RUN git config --global --add safe.directory /workdir
|
RUN git config --global --add safe.directory '*'
|
||||||
|
|
||||||
# Set the entrypoint to run the installed binary in /workdir
|
# Set the entrypoint to run the installed binary in /workdir
|
||||||
# Example: docker run -it -v "$PWD:/workdir" kamal init
|
# Example: docker run -it -v "$PWD:/workdir" kamal init
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
kamal (1.9.1)
|
kamal (1.9.3)
|
||||||
activesupport (>= 7.0)
|
activesupport (>= 7.0)
|
||||||
base64 (~> 0.2)
|
base64 (~> 0.2)
|
||||||
bcrypt_pbkdf (~> 1.0)
|
bcrypt_pbkdf (~> 1.0)
|
||||||
@@ -78,11 +78,11 @@ GEM
|
|||||||
net-sftp (4.0.0)
|
net-sftp (4.0.0)
|
||||||
net-ssh (>= 5.0.0, < 8.0.0)
|
net-ssh (>= 5.0.0, < 8.0.0)
|
||||||
net-ssh (7.2.1)
|
net-ssh (7.2.1)
|
||||||
nokogiri (1.16.0-arm64-darwin)
|
nokogiri (1.18.8-arm64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.0-x86_64-darwin)
|
nokogiri (1.18.8-x86_64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.0-x86_64-linux)
|
nokogiri (1.18.8-x86_64-linux-gnu)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
parallel (1.24.0)
|
parallel (1.24.0)
|
||||||
parser (3.3.0.5)
|
parser (3.3.0.5)
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ module Kamal::Cli
|
|||||||
|
|
||||||
def load_env
|
def load_env
|
||||||
if destination = options[:destination]
|
if destination = options[:destination]
|
||||||
Dotenv.load(".env.#{destination}", ".env")
|
Dotenv.overload(".env", ".env.#{destination}")
|
||||||
else
|
else
|
||||||
Dotenv.load(".env")
|
Dotenv.overload(".env")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module Kamal
|
module Kamal
|
||||||
VERSION = "1.9.1"
|
VERSION = "1.9.3"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -490,6 +490,39 @@ class CliMainTest < CliTestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "env files overwrite shell environment variables" do
|
||||||
|
ENV["TEST_VAR"] = "shell_value"
|
||||||
|
ENV["AWS_ACCESS_KEY_ID"] = "local_dev_key"
|
||||||
|
|
||||||
|
with_test_dotenv(".env": "TEST_VAR=dotenv_value\nAWS_ACCESS_KEY_ID=production_key") do
|
||||||
|
# Create a simple CLI command instance to trigger load_env
|
||||||
|
Kamal::Cli::Main.new.send(:load_env)
|
||||||
|
|
||||||
|
assert_equal "dotenv_value", ENV["TEST_VAR"]
|
||||||
|
assert_equal "production_key", ENV["AWS_ACCESS_KEY_ID"]
|
||||||
|
end
|
||||||
|
ensure
|
||||||
|
ENV.delete("TEST_VAR")
|
||||||
|
ENV.delete("AWS_ACCESS_KEY_ID")
|
||||||
|
end
|
||||||
|
|
||||||
|
test "destination env files overwrite base env files" do
|
||||||
|
ENV["TEST_VAR"] = "shell_value"
|
||||||
|
|
||||||
|
with_test_dotenv(".env": "TEST_VAR=base_value\nBASE_ONLY=base", ".env.world": "TEST_VAR=world_value\nWORLD_ONLY=world") do
|
||||||
|
# Create CLI command with destination to trigger load_env
|
||||||
|
Kamal::Cli::Main.new([], { destination: "world" }).send(:load_env)
|
||||||
|
|
||||||
|
assert_equal "world_value", ENV["TEST_VAR"]
|
||||||
|
assert_equal "base", ENV["BASE_ONLY"]
|
||||||
|
assert_equal "world", ENV["WORLD_ONLY"]
|
||||||
|
end
|
||||||
|
ensure
|
||||||
|
ENV.delete("TEST_VAR")
|
||||||
|
ENV.delete("BASE_ONLY")
|
||||||
|
ENV.delete("WORLD_ONLY")
|
||||||
|
end
|
||||||
|
|
||||||
test "remove with confirmation" do
|
test "remove with confirmation" do
|
||||||
run_command("remove", "-y", config_file: "deploy_with_accessories").tap do |output|
|
run_command("remove", "-y", config_file: "deploy_with_accessories").tap do |output|
|
||||||
assert_match /docker container stop traefik/, output
|
assert_match /docker container stop traefik/, output
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM registry
|
FROM registry:3
|
||||||
|
|
||||||
COPY boot.sh .
|
COPY boot.sh .
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
exec /entrypoint.sh /etc/docker/registry/config.yml
|
exec /entrypoint.sh /etc/distribution/config.yml
|
||||||
|
|||||||
Reference in New Issue
Block a user