#!/usr/bin/env bash VERSION="v2.3.8" # based on remote-2.0.2 warn() { echo "$@" >&2; } die() { warn "$@"; exit 1; } perl -MNarada -E 'Narada::detect(@ARGV)' || exit 1 if ! [ -f config/remote -a -s config/remote ]; then echo "error: configure config/remote first" exit 1; fi host=$(sed 's,:.*,,' < config/remote); path=$(sed 's,^[^:]*:,,' < config/remote); if [ "$host" == "" ]; then echo "error: config/remote should contain: [user@]host:[path/to/dir/]" exit 1 fi if [ $# = 2 -a "$1" = '-t' ]; then ssh_param='-t' shift fi if [ $# != 1 ]; then echo "Usage: $(basename $0) [-t] 'your command here'" exit 1 fi ssh $ssh_param "$host" bash -l -c \' 'cd "'"$path"'";'"$1" \' : <<'=cut' =encoding utf8 =head1 NAME narada-remote - use ssh to execute command on remote host in project root =head1 VERSION This document describes narada-remote version v2.3.8 =head1 USAGE narada-remote [-t] 'your command here' =head1 DESCRIPTION Should be executed in project deploy directory (or Narada 1.x project root directory). Before using set C to remote address in ssh format: [user@]host:[path/to/dir/] When executed with -t option will call ssh with -t parameter. =head1 CONFIGURATION AND ENVIRONMENT config/remote =head1 SUPPORT =head2 Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker at L. You will be notified automatically of any progress on your issue. =head2 Source Code This is open source software. The code repository is available for public review and contribution under the terms of the license. Feel free to fork the repository and submit pull requests. L git clone https://github.com/powerman/Narada.git =head2 Resources =over =item * MetaCPAN Search L =item * CPAN Ratings L =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Testers Matrix L =item * CPANTS: A CPAN Testing Service (Kwalitee) L =back =head1 AUTHOR Alex Efros Epowerman@cpan.orgE =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2008- by Alex Efros Epowerman@cpan.orgE. This is free software, licensed under: The MIT (X11) License =cut