mirror of
https://gitee.com/jack_whh/ssh-scp-ssh-pipelines.git
synced 2026-03-09 22:42:55 +08:00
try not process exp in ()
This commit is contained in:
6
.github/workflows/deploy.yml
vendored
6
.github/workflows/deploy.yml
vendored
@@ -44,10 +44,10 @@ jobs:
|
|||||||
host: ${{ secrets.DC_HOST }}
|
host: ${{ secrets.DC_HOST }}
|
||||||
user: ${{ secrets.DC_USER }}
|
user: ${{ secrets.DC_USER }}
|
||||||
pass: ${{ secrets.DC_PASS }}
|
pass: ${{ secrets.DC_PASS }}
|
||||||
scp: |
|
scp: |-
|
||||||
./test/test1* => /home/github/test/test1/
|
./test/test1* => /home/github/test/test1/
|
||||||
./test/test*.csv => "/home/github/test/test2/"
|
./test/test*.csv => "/home/github/test/test2/"
|
||||||
last_ssh: |
|
last_ssh: |-
|
||||||
echo $LASTSSH
|
echo $LASTSSH
|
||||||
ls -la
|
ls -la
|
||||||
|
|
||||||
@@ -59,5 +59,5 @@ jobs:
|
|||||||
host: ${{ secrets.DC_HOST }}
|
host: ${{ secrets.DC_HOST }}
|
||||||
user: ${{ secrets.DC_USER }}
|
user: ${{ secrets.DC_USER }}
|
||||||
pass: ${{ secrets.DC_PASS }}
|
pass: ${{ secrets.DC_PASS }}
|
||||||
scp: |
|
scp: |-
|
||||||
'./test/*' => /home/github/test/
|
'./test/*' => /home/github/test/
|
||||||
@@ -32,10 +32,14 @@ executeSSH() {
|
|||||||
# evaluate each line against all environment variables
|
# evaluate each line against all environment variables
|
||||||
while IFS= read -r LINE; do
|
while IFS= read -r LINE; do
|
||||||
LINE=$(echo $LINE)
|
LINE=$(echo $LINE)
|
||||||
|
if [[ -z "${LINE}" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
COMBINE="&&"
|
COMBINE="&&"
|
||||||
LASTCOMBINE="&&"
|
LASTCOMBINE=""
|
||||||
if [[ $LINE =~ ^.*\&\&$ ]]; then
|
if [[ $LINE =~ ^.*\&\&$ ]]; then
|
||||||
LINE="$LINE true"
|
LINE="$LINE true"
|
||||||
|
LASTCOMBINE="&&"
|
||||||
elif [[ $LINE =~ ^\&\&.*$ ]]; then
|
elif [[ $LINE =~ ^\&\&.*$ ]]; then
|
||||||
LINE="true $LINE"
|
LINE="true $LINE"
|
||||||
elif [[ $LINE =~ ^.*\|\|$ ]]; then
|
elif [[ $LINE =~ ^.*\|\|$ ]]; then
|
||||||
@@ -46,6 +50,9 @@ executeSSH() {
|
|||||||
COMBINE="||"
|
COMBINE="||"
|
||||||
fi
|
fi
|
||||||
LINE=$(eval 'echo "$LINE"')
|
LINE=$(eval 'echo "$LINE"')
|
||||||
|
if ! [[ $LINE =~ ^\(.*\)$ ]]; then
|
||||||
|
LINE=$(eval echo "$LINE")
|
||||||
|
fi
|
||||||
LINE="$LINE $LASTCOMBINE"
|
LINE="$LINE $LASTCOMBINE"
|
||||||
|
|
||||||
if [ -z "$COMMANDS" ]; then
|
if [ -z "$COMMANDS" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user