Merge pull request #499 from basecamp/env-only-needed-for-push
Remove the env check
This commit is contained in:
@@ -124,9 +124,17 @@ class CliMainTest < CliTestCase
|
||||
end
|
||||
|
||||
test "deploy with missing secrets" do
|
||||
assert_raises(KeyError) do
|
||||
run_command("deploy", config_file: "deploy_with_secrets")
|
||||
end
|
||||
invoke_options = { "config_file" => "test/fixtures/deploy_with_secrets.yml", "version" => "999", "skip_hooks" => false }
|
||||
|
||||
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:registry:login", [], invoke_options)
|
||||
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:build:deliver", [], invoke_options)
|
||||
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:traefik:boot", [], invoke_options)
|
||||
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:healthcheck:perform", [], invoke_options)
|
||||
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:app:stale_containers", [], invoke_options.merge(stop: true))
|
||||
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:app:boot", [], invoke_options)
|
||||
Kamal::Cli::Main.any_instance.expects(:invoke).with("kamal:cli:prune:all", [], invoke_options)
|
||||
|
||||
run_command("deploy", config_file: "deploy_with_secrets")
|
||||
end
|
||||
|
||||
test "redeploy" do
|
||||
|
||||
@@ -128,14 +128,6 @@ class ConfigurationTest < ActiveSupport::TestCase
|
||||
assert_equal "healthcheck-app", @config.healthcheck_service
|
||||
end
|
||||
|
||||
test "env with missing secret" do
|
||||
assert_raises(KeyError) do
|
||||
config = Kamal::Configuration.new(@deploy.tap { |c| c.merge!({
|
||||
env: { "secret" => [ "PASSWORD" ] }
|
||||
}) }).ensure_env_available
|
||||
end
|
||||
end
|
||||
|
||||
test "valid config" do
|
||||
assert @config.valid?
|
||||
assert @config_with_roles.valid?
|
||||
|
||||
@@ -5,6 +5,7 @@ class MainTest < IntegrationTest
|
||||
kamal :envify
|
||||
assert_local_env_file "SECRET_TOKEN=1234"
|
||||
assert_remote_env_file "SECRET_TOKEN=1234\nCLEAR_TOKEN=4321"
|
||||
remove_local_env_file
|
||||
|
||||
first_version = latest_app_version
|
||||
|
||||
@@ -64,6 +65,10 @@ class MainTest < IntegrationTest
|
||||
assert_equal contents, deployer_exec("cat .env", capture: true)
|
||||
end
|
||||
|
||||
def remove_local_env_file
|
||||
deployer_exec("rm .env")
|
||||
end
|
||||
|
||||
def assert_remote_env_file(contents)
|
||||
assert_equal contents, docker_compose("exec vm1 cat /root/.kamal/env/roles/app-web.env", capture: true)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user