Skip to content

Commit

Permalink
Update deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
ije committed Mar 11, 2024
1 parent 4b45c29 commit 65626c0
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,21 @@ if [ "$v" != "" ]; then
sshPort="$v"
fi

scriptsDir=$(dirname $0)
sh $scriptsDir/build.sh
cd $(dirname $0)
sh build.sh

if [ "$?" != "0" ]; then
exit
fi

echo "--- compressing..."
tar -czf esmd.tar.gz esmd

echo "--- uploading..."
scp -P $sshPort $scriptsDir/esmd $user@$host:/tmp/esmd
scp -P $sshPort esmd.tar.gz $user@$host:/tmp/esmd.tar.gz
if [ "$?" != "0" ]; then
rm -f $scriptsDir/esmd
rm -f esmd
rm -f esmd.tar.gz
exit
fi

Expand All @@ -115,9 +119,12 @@ ssh -p $sshPort $user@$host << EOF
echo "\$1" >> \$SVCF
}
cd /tmp
tar -xzf esmd.tar.gz
supervisorctl stop esmd
rm -f /usr/local/bin/esmd
mv -f /tmp/esmd /usr/local/bin/esmd
mv -f esmd /usr/local/bin/esmd
chmod +x /usr/local/bin/esmd
if [ "$init" == "yes" ]; then
Expand All @@ -139,4 +146,5 @@ ssh -p $sshPort $user@$host << EOF
fi
EOF

rm -f $scriptsDir/esmd
rm -f esmd
rm -f esmd.tar.gz

0 comments on commit 65626c0

Please sign in to comment.