Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests and CI #375

Merged
merged 3 commits into from
Aug 7, 2024
Merged

Add tests and CI #375

merged 3 commits into from
Aug 7, 2024

Commits on Jul 9, 2024

  1. Add tests and CI

    Deploying with Capistrano and systemd can be difficult to verify manually, so I automated the verification using tests and CI. I used a Debian Docker image to create a container running systemd, and deployed a small Sinatra application to confirm it works.
    
    With mostly default settings, I confirmed that the four tasks puma:install, deploy, puma:stop, and puma:start work as expected. It would be good to also verify other tasks and the nginx configuration, but for now, this provides the minimum necessary verification.
    willnet committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    3af52c8 View commit details
    Browse the repository at this point in the history
  2. Fix cap production puma:install due to loginctl need sudo

    ```
    #<Thread:0x000000012a5d7570 /Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
    /Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as willnet@localhost: Exception while executing as willnet@localhost: loginctl exit status: 1 (SSHKit::Runner::ExecuteError)
    loginctl stdout: Nothing written
    loginctl stderr: Could not enable linger: Access denied
    
    	from /Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
    /Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as willnet@localhost: loginctl exit status: 1 (SSHKit::Runner::ExecuteError)
    loginctl stdout: Nothing written
    loginctl stderr: Could not enable linger: Access denied
    
    	from /Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
    /Users/willnet/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/sshkit-1.22.2/lib/sshkit/command.rb:97:in `exit_status=': loginctl exit status: 1 (SSHKit::Command::Failed)
    loginctl stdout: Nothing written
    loginctl stderr: Could not enable linger: Access denied
    ```
    willnet committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    24029e9 View commit details
    Browse the repository at this point in the history
  3. Fix ci on Ruby 2.5

    Fix an issue where the argument passing method for ERB.new in Ruby 2.5 differs from Ruby 2.6 and above, causing errors during template generation.
    
    ```
    SSHKit::Runner::ExecuteError: Exception while executing as willnet@localhost: no implicit conversion of Hash into Integer
    ```
    
    ref: https://ruby-doc.org/stdlib-2.5.0/libdoc/erb/rdoc/ERB.html#method-c-new
    willnet committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    b53f608 View commit details
    Browse the repository at this point in the history