Skip to content

Commit

Permalink
qf: fix deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
SwanX1 committed Aug 28, 2024
1 parent d9371af commit 685b95e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,28 @@ cd $SERVICE_PATH

# Checkout the latest commit on GIT_BRANCH
git fetch origin -v
if [ $! -ne 0 ]; then
if [ "$!" -ne 0 ]; then
echo "Failed to fetch."
exit 1
fi
git checkout origin/$GIT_BRANCH
if [ $! -ne 0 ]; then
if [ "$!" -ne 0 ]; then
echo "Failed to checkout the latest commit."
exit 1
fi

# Install the dependencies
yarn install --frozen-lockfile --non-interactive --verbose

if [ $! -ne 0 ]; then
if [ "$!" -ne 0 ]; then
echo "Failed to install the dependencies."
exit 1
fi

# We use build:only here, because we don't want to run any checks beforehand. Those are handled by GH Actions.
yarn build:only --verbose
yarn build:only

if [ $! -ne 0 ]; then
if [ "$!" -ne 0 ]; then
echo "Failed to build, this should be unreachable."
echo "Ignoring this, since tsc transpiles everything regardless of errors."
echo "This should have been caught by GH Actions."
Expand All @@ -80,7 +80,7 @@ fi
if [ ! -z "$(screen -ls $SERVICE_NAME | grep $SERVICE_NAME)" ]; then
echo "Service is already running, stopping it."
screen -S $SERVICE_NAME -X quit
if [ $! -ne 0 ]; then
if [ "$!" -ne 0 ]; then
echo "Failed to stop the service."
exit 1
fi
Expand All @@ -89,7 +89,7 @@ fi
echo "Starting the service."
screen -dmqS $SERVICE_NAME yarn start

if [ $! -ne 0 ]; then
if [ "$!" -ne 0 ]; then
echo "Failed to start the service."
exit 1
fi

0 comments on commit 685b95e

Please sign in to comment.