Compare commits
16 Commits
v1.9.0
...
1-9-stable
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d141c82efa | ||
|
|
cdb6c014ac | ||
|
|
7ded6d3aef | ||
|
|
2ea60bea5e | ||
|
|
3948a95e7a | ||
|
|
21d7d6d79c | ||
|
|
f1b3c4a4fb | ||
|
|
fd9564f0c8 | ||
|
|
d2338251a9 | ||
|
|
b00a4ec3e2 | ||
|
|
4b09375ccd | ||
|
|
3e0302230e | ||
|
|
bce2d35e9f | ||
|
|
46ea88a056 | ||
|
|
fa05270cac | ||
|
|
b058c45973 |
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -3,7 +3,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 1-8-stable
|
||||
- 1-9-stable
|
||||
pull_request:
|
||||
jobs:
|
||||
rubocop:
|
||||
@@ -31,6 +31,9 @@ jobs:
|
||||
gemfile:
|
||||
- Gemfile
|
||||
- gemfiles/rails_edge.gemfile
|
||||
exclude:
|
||||
- ruby-version: "3.1"
|
||||
gemfile: gemfiles/rails_edge.gemfile
|
||||
name: ${{ format('Tests (Ruby {0})', matrix.ruby-version) }}
|
||||
runs-on: ubuntu-latest
|
||||
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
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/basecamp/kamal:latest
|
||||
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
|
||||
# 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
|
||||
# Example: docker run -it -v "$PWD:/workdir" kamal init
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
kamal (1.9.0)
|
||||
kamal (1.9.3)
|
||||
activesupport (>= 7.0)
|
||||
base64 (~> 0.2)
|
||||
bcrypt_pbkdf (~> 1.0)
|
||||
@@ -78,11 +78,11 @@ GEM
|
||||
net-sftp (4.0.0)
|
||||
net-ssh (>= 5.0.0, < 8.0.0)
|
||||
net-ssh (7.2.1)
|
||||
nokogiri (1.16.0-arm64-darwin)
|
||||
nokogiri (1.18.8-arm64-darwin)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.16.0-x86_64-darwin)
|
||||
nokogiri (1.18.8-x86_64-darwin)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.16.0-x86_64-linux)
|
||||
nokogiri (1.18.8-x86_64-linux-gnu)
|
||||
racc (~> 1.4)
|
||||
parallel (1.24.0)
|
||||
parser (3.3.0.5)
|
||||
|
||||
@@ -37,9 +37,9 @@ module Kamal::Cli
|
||||
|
||||
def load_env
|
||||
if destination = options[:destination]
|
||||
Dotenv.load(".env.#{destination}", ".env")
|
||||
Dotenv.overload(".env", ".env.#{destination}")
|
||||
else
|
||||
Dotenv.load(".env")
|
||||
Dotenv.overload(".env")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ traefik:
|
||||
|
||||
# Image
|
||||
#
|
||||
# The Traefik image to use, defaults to `traefik:v2.10`
|
||||
image: traefik:v2.9
|
||||
# The Traefik image to use, defaults to `traefik:v2.11`
|
||||
image: traefik:v2.11
|
||||
|
||||
# Host port
|
||||
#
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Kamal::Configuration::Traefik
|
||||
DEFAULT_IMAGE = "traefik:v2.10"
|
||||
DEFAULT_IMAGE = "traefik:v2.11"
|
||||
CONTAINER_PORT = 80
|
||||
DEFAULT_ARGS = {
|
||||
"log.level" => "DEBUG"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Kamal
|
||||
VERSION = "1.9.0"
|
||||
VERSION = "1.9.3"
|
||||
end
|
||||
|
||||
@@ -490,6 +490,39 @@ class CliMainTest < CliTestCase
|
||||
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
|
||||
run_command("remove", "-y", config_file: "deploy_with_accessories").tap do |output|
|
||||
assert_match /docker container stop traefik/, output
|
||||
|
||||
@@ -139,7 +139,7 @@ class CliTraefikTest < CliTestCase
|
||||
assert_match "docker image prune --all --force --filter label=org.opencontainers.image.title=Traefik", output
|
||||
assert_match "/usr/bin/env mkdir -p .kamal", output
|
||||
assert_match "docker login -u [REDACTED] -p [REDACTED]", output
|
||||
assert_match "docker container start traefik || docker run --name traefik --detach --restart unless-stopped --publish 80:80 --volume /var/run/docker.sock:/var/run/docker.sock --env-file .kamal/env/traefik/traefik.env --log-opt max-size=\"10m\" --label traefik.http.routers.catchall.entryPoints=\"http\" --label traefik.http.routers.catchall.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.catchall.service=\"unavailable\" --label traefik.http.routers.catchall.priority=\"1\" --label traefik.http.services.unavailable.loadbalancer.server.port=\"0\" traefik:v2.10 --providers.docker --log.level=\"DEBUG\"", output
|
||||
assert_match "docker container start traefik || docker run --name traefik --detach --restart unless-stopped --publish 80:80 --volume /var/run/docker.sock:/var/run/docker.sock --env-file .kamal/env/traefik/traefik.env --log-opt max-size=\"10m\" --label traefik.http.routers.catchall.entryPoints=\"http\" --label traefik.http.routers.catchall.rule=\"PathPrefix(\\`/\\`)\" --label traefik.http.routers.catchall.service=\"unavailable\" --label traefik.http.routers.catchall.priority=\"1\" --label traefik.http.services.unavailable.loadbalancer.server.port=\"0\" traefik:v2.11 --providers.docker --log.level=\"DEBUG\"", output
|
||||
assert_match "/usr/bin/env mkdir -p .kamal", output
|
||||
assert_match %r{docker rename app-web-latest app-web-latest_replaced_.*}, output
|
||||
assert_match %r{docker run --detach --restart unless-stopped --name app-web-latest --hostname 1.1.1.1-.* -e KAMAL_CONTAINER_NAME="app-web-latest" -e KAMAL_VERSION="latest" --env-file .kamal/env/roles/app-web.env --health-cmd}, output
|
||||
|
||||
@@ -33,7 +33,7 @@ traefik:
|
||||
args:
|
||||
accesslog: true
|
||||
accesslog.format: json
|
||||
image: registry:4443/traefik:v2.10
|
||||
image: registry:4443/traefik:v2.11
|
||||
accessories:
|
||||
busybox:
|
||||
service: custom-busybox
|
||||
|
||||
@@ -27,7 +27,7 @@ traefik:
|
||||
args:
|
||||
accesslog: true
|
||||
accesslog.format: json
|
||||
image: registry:4443/traefik:v2.10
|
||||
image: registry:4443/traefik:v2.11
|
||||
accessories:
|
||||
busybox:
|
||||
service: custom-busybox
|
||||
|
||||
@@ -19,7 +19,7 @@ push_image_to_registry_4443() {
|
||||
|
||||
install_kamal
|
||||
push_image_to_registry_4443 nginx 1-alpine-slim
|
||||
push_image_to_registry_4443 traefik v2.10
|
||||
push_image_to_registry_4443 traefik v2.11
|
||||
push_image_to_registry_4443 busybox 1.36.0
|
||||
|
||||
# .ssh is on a shared volume that persists between runs. Clean it up as the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM registry
|
||||
FROM registry:3
|
||||
|
||||
COPY boot.sh .
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
exec /entrypoint.sh /etc/docker/registry/config.yml
|
||||
exec /entrypoint.sh /etc/distribution/config.yml
|
||||
|
||||
@@ -32,7 +32,7 @@ class MainTest < IntegrationTest
|
||||
assert_match /Traefik Host: vm2/, details
|
||||
assert_match /App Host: vm1/, details
|
||||
assert_match /App Host: vm2/, details
|
||||
assert_match /traefik:v2.10/, details
|
||||
assert_match /traefik:v2.11/, details
|
||||
assert_match /registry:4443\/app:#{first_version}/, details
|
||||
|
||||
audit = kamal :audit, capture: true
|
||||
|
||||
@@ -52,11 +52,11 @@ class TraefikTest < IntegrationTest
|
||||
|
||||
private
|
||||
def assert_traefik_running
|
||||
assert_match /traefik:v2.10 "\/entrypoint.sh/, traefik_details
|
||||
assert_match /traefik:v2.11 "\/entrypoint.sh/, traefik_details
|
||||
end
|
||||
|
||||
def assert_traefik_not_running
|
||||
assert_no_match /traefik:v2.10 "\/entrypoint.sh/, traefik_details
|
||||
assert_no_match /traefik:v2.11 "\/entrypoint.sh/, traefik_details
|
||||
end
|
||||
|
||||
def traefik_details
|
||||
|
||||
Reference in New Issue
Block a user