|
1 | 1 | #!/bin/bash
|
2 | 2 |
|
3 | 3 | # Exit on error
|
4 |
| -set -e |
| 4 | +set -eu |
| 5 | +set -o pipefail |
5 | 6 |
|
6 | 7 | # Color definitions
|
7 | 8 | RED='\033[0;31m'
|
@@ -61,6 +62,7 @@ SYNC_TRANSLATIONS=true
|
61 | 62 | BUILD_ENV=""
|
62 | 63 | DEPLOY_ONLY=false
|
63 | 64 | SAME_AS=""
|
| 65 | +VERSION_PROVIDED_BY_USER=false |
64 | 66 |
|
65 | 67 | # Define deploy servers for different environments
|
66 | 68 | MAINNET_SERVERS=("deploy_${APP_NAME}@web-1" "deploy_${APP_NAME}@web-2" "deploy_${APP_NAME}@web-3" "deploy_${APP_NAME}@web-4")
|
|
303 | 305 | # Get up-to-date EBA RT1 bank list (disabled while OASIS is not available)
|
304 | 306 | # yarn utils:getBankList
|
305 | 307 |
|
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 |
| - |
311 | 308 | # 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 |
316 | 313 |
|
317 | 314 | # Function to create commit/tag message
|
318 | 315 | create_message() {
|
|
343 | 340 |
|
344 | 341 | # Build the project
|
345 | 342 | 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" |
347 | 344 |
|
348 | 345 | # Deploy to deployment repository
|
349 | 346 | echo -e "${BLUE}Deploying to $DEPLOYMENT_REPO...${NC}"
|
350 | 347 | run_command "cd \"$DEPLOYMENT_REPO\" || exit 1" "Failed to change to deployment directory"
|
351 | 348 |
|
352 | 349 | # 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") |
354 | 351 | echo -e "${CYAN}Checking out $DEPLOY_BRANCH branch...${NC}"
|
355 | 352 | run_command "git checkout $DEPLOY_BRANCH" "Failed to checkout branch"
|
356 | 353 | run_command "git pull" "Failed to pull latest changes"
|
|
0 commit comments