Skip to content

Command mapping #56

@pmeinhardt

Description

@pmeinhardt

Hey there, thanks for creating this gem 🙇

I've run into an issue when following the instructions in the README as the shared_path is not necessarily set correctly when you define the command mapping in the top-level scope.

Instead, what worked for me was to defer the mapping until after deploy:starting, where we can be sure the shared_path is initialized to the correct value:

namespace :deploy do
  # Add command mappings
  after :starting, :map_commands do
    SSHKit.config.command_map[:composer] = "php #{shared_path.join('composer.phar')}"
  end

  # Install composer (https://getcomposer.org/)
  after :starting, 'composer:install_executable'

  # …
end

Maybe it'd make sense to update the README and composer:install_executable task description?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions