Skip to content

Commit

Permalink
Update deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
ije committed Jan 14, 2025
1 parent 782bd79 commit bc2833f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
15 changes: 8 additions & 7 deletions scripts/deploy-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ fi

echo "--- installing server..."
ssh esm.sh << EOF
cd /tmp
tar -xzf esmd.tar.gz
if [ "\$?" != "0" ]; then
exit 1
fi
chmod +x esmd
rm -f esmd.tar.gz
git version
if [ "\$?" == "127" ]; then
apt-get update
Expand Down Expand Up @@ -84,13 +92,6 @@ ssh esm.sh << EOF
nohup rm -rf /tmp/.esm &
fi
cd /tmp
tar -xzf esmd.tar.gz
if [ "\$?" != "0" ]; then
exit 1
fi
rm -f esmd.tar.gz
chmod +x esmd
mv -f esmd /usr/local/bin/esmd
if [ "\$reload" == "yes" ]; then
Expand Down
19 changes: 12 additions & 7 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ fi

echo "--- installing..."
ssh -p $sshPort ${user}@${host} << EOF
cd /tmp
tar -xzf esmd.tar.gz
if [ "\$?" != "0" ]; then
exit 1
fi
chmod +x esmd
rm -f esmd.tar.gz
git version
if [ "\$?" == "127" ]; then
apt-get update
Expand All @@ -84,6 +92,10 @@ ssh -p $sshPort ${user}@${host} << EOF
echo "Failed to add user 'esm'"
exit 1
fi
ufw version
if [ "\$?" == "0" ]; then
ufw allow http
fi
echo "[Unit]" >> \$servicefile
echo "Description=esm.sh service" >> \$servicefile
echo "After=network.target" >> \$servicefile
Expand Down Expand Up @@ -113,13 +125,6 @@ ssh -p $sshPort ${user}@${host} << EOF
echo "Stopped esmd.service."
fi
cd /tmp
tar -xzf esmd.tar.gz
if [ "\$?" != "0" ]; then
exit 1
fi
rm -f esmd.tar.gz
chmod +x esmd
mv -f esmd /usr/local/bin/esmd
if [ "$init" == "yes" ]; then
Expand Down

0 comments on commit bc2833f

Please sign in to comment.