Files
kamal/test/integration/accessory_test.rb
Donal McBreen d2f57b1889 Remove the envify command
Instead of using `kamal envify` to generate the .env file, we now assume
that it will be in place for us.

Options in place of `kamal envify`:
1. Pre-generate the .env file
2. Create the env file in the `.pre-init` hook
3. Log into a secret store/check you are logged in in the pre-init hook
   Then use .dotenv command and variable substitution to interpolate the
   secrets.
2024-07-30 17:26:45 +01:00

39 lines
1.1 KiB
Ruby

require_relative "integration_test"
class AccessoryTest < IntegrationTest
test "boot, stop, start, restart, logs, remove" do
kamal :accessory, :boot, :busybox
assert_accessory_running :busybox
kamal :accessory, :stop, :busybox
assert_accessory_not_running :busybox
kamal :accessory, :start, :busybox
assert_accessory_running :busybox
kamal :accessory, :restart, :busybox
assert_accessory_running :busybox
logs = kamal :accessory, :logs, :busybox, capture: true
assert_match /Starting busybox.../, logs
kamal :accessory, :remove, :busybox, "-y"
assert_accessory_not_running :busybox
kamal :env, :delete
end
private
def assert_accessory_running(name)
assert_match /registry:4443\/busybox:1.36.0 "sh -c 'echo \\"Start/, accessory_details(name)
end
def assert_accessory_not_running(name)
assert_no_match /registry:4443\/busybox:1.36.0 "sh -c 'echo \\"Start/, accessory_details(name)
end
def accessory_details(name)
kamal :accessory, :details, name, capture: true
end
end