Skip to content

Commit 420f886

Browse files
committed
Fix deploy.sh script errors & implement feedback
1 parent 82237f3 commit 420f886

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

deploy.sh

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/bash
22

33
# Exit on error
4-
set -e
4+
set -eu
5+
set -o pipefail
56

67
# Color definitions
78
RED='\033[0;31m'
@@ -61,6 +62,7 @@ SYNC_TRANSLATIONS=true
6162
BUILD_ENV=""
6263
DEPLOY_ONLY=false
6364
SAME_AS=""
65+
VERSION_PROVIDED_BY_USER=false
6466

6567
# Define deploy servers for different environments
6668
MAINNET_SERVERS=("deploy_${APP_NAME}@web-1" "deploy_${APP_NAME}@web-2" "deploy_${APP_NAME}@web-3" "deploy_${APP_NAME}@web-4")
@@ -303,16 +305,11 @@ fi
303305
# Get up-to-date EBA RT1 bank list (disabled while OASIS is not available)
304306
# yarn utils:getBankList
305307

306-
# Get up-to-date browsers support list from caniuse.
307-
# The browserslist utility is meant to run via npx, even when usually using yarn, and is compatible with yarn.lock.
308-
echo -e "${CYAN}Updating browsers support list...${NC}"
309-
run_command "yarn update-browserslist" "Failed to update browsers list"
310-
311308
# Check for uncommitted changes
312-
# if [[ `git status --porcelain` ]]; then
313-
# echo -e "${RED}ERROR: The repository has uncommitted changes. Commit them first, then run again.${NC}"
314-
# exit 1
315-
# fi
309+
if [[ `git status --porcelain` ]]; then
310+
echo -e "${RED}ERROR: The repository has uncommitted changes. Commit them first, then run again.${NC}"
311+
exit 1
312+
fi
316313

317314
# Function to create commit/tag message
318315
create_message() {
@@ -343,14 +340,14 @@ fi
343340

344341
# Build the project
345342
echo -e "${BLUE}Building project with $BUILD_ENV configuration...${NC}"
346-
run_command "env \"build=$BUILD_ENV\" yarn build" "Failed to build project"
343+
run_command "yarn build $BUILD_ENV" "Failed to build project"
347344

348345
# Deploy to deployment repository
349346
echo -e "${BLUE}Deploying to $DEPLOYMENT_REPO...${NC}"
350347
run_command "cd \"$DEPLOYMENT_REPO\" || exit 1" "Failed to change to deployment directory"
351348

352349
# Checkout appropriate branch and pull latest changes
353-
DEPLOY_BRANCH=$([ "$BUILD_ENV" = "mainnet" ] && echo "mainnet" || echo "testnet")
350+
DEPLOY_BRANCH=$([ "$BUILD_ENV" = "mainnet" ] && echo "master" || echo "testnet")
354351
echo -e "${CYAN}Checking out $DEPLOY_BRANCH branch...${NC}"
355352
run_command "git checkout $DEPLOY_BRANCH" "Failed to checkout branch"
356353
run_command "git pull" "Failed to pull latest changes"

0 commit comments

Comments
 (0)