LINUX.ORG.RU

История изменений

Исправление Yur4eg, (текущая версия) :

#!/bin/bash

case $1 in
    dev)
    target="deploy@1.2.3.4"
    ;;
    test)
    target="deploy@1.2.3.5"
    *)
    target=$1
    ;;
esac

way="/var/www/builds/"
front="/var/www/html/test1/"
file="$way/front_build_$1.tar.gz"
key="/var/www/conf/id_rsa"

scp -i $key $file $target:/var/www/html/test/

ssh -i $key $target "tar xvf /var/www/html/test/front_build_$2.tar.gz --overwrite-dir --exclude='./cache' --exclude='./logs' -C $front"

Исходная версия Yur4eg, :

#!/bin/bash

case $1 in
    dev)
    target="deploy@1.2.3.4"
    ;;
    test)
    target="deploy@1.2.3.5"
    *)
    target=$1
    ;;
esac

way="/var/www/builds/"
front="/var/www/html/test1/"
file="$way/front_build_$1.tar.gz"
key="/var/www/conf/id_rsa"

scp -i $key $file $server:/var/www/html/test/

ssh -i $key $test "tar xvf /var/www/html/test/front_build_$2.tar.gz --overwrite-dir --exclude='./cache' --exclude='./logs' -C $front"