Skip to content

Added possibility to decorate shell command#96

Open
nuvolapl wants to merge 1 commit intoEasyCorp:masterfrom
nuvolapl:master
Open

Added possibility to decorate shell command#96
nuvolapl wants to merge 1 commit intoEasyCorp:masterfrom
nuvolapl:master

Conversation

@nuvolapl
Copy link

@nuvolapl nuvolapl commented Aug 16, 2019

Example

$builder = $this->getConfigBuilder();
$builder
    ->server(
        'user@host',
        [
            Server::ROLE_APP,
        ],
        [
            Property::command_decorator => function (Server $server, string $shellCommand, array $envVars) {
                return \sprintf("sudo chroot /srv/app/ bash -c '%s'", $shellCommand);
            },
        ]
    )
;

... will execute: ssh user@host 'sudo chroot /srv/app/ bash -c \'echo "hello"\''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant