summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBug Magnet <marco.nikic@mullvad.net>2025-03-11 16:54:00 +0100
committerBug Magnet <marco.nikic@mullvad.net>2025-03-13 08:54:27 +0100
commit2df0d0d9020edac9fe7be64b7504004fa9b4b442 (patch)
tree9cc62a6b55b5e69592f2c950abd49e6efcc8634e
parent39125664d7e5947f6e627c99ce216b0fa39b733c (diff)
downloadmullvadvpn-2df0d0d9020edac9fe7be64b7504004fa9b4b442.tar.xz
mullvadvpn-2df0d0d9020edac9fe7be64b7504004fa9b4b442.zip
Build and cache relay list per configuration excluding Release
-rwxr-xr-xios/relays-prebuild.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/ios/relays-prebuild.sh b/ios/relays-prebuild.sh
index 072d81d260..b583611ca3 100755
--- a/ios/relays-prebuild.sh
+++ b/ios/relays-prebuild.sh
@@ -7,13 +7,27 @@ fi
RELAYS_FILE="$PROJECT_DIR/MullvadREST/Assets/relays.json"
+# Do not download the file for release builds, a different script will take care of that.
+if [ "$CONFIGURATION" == "Release" ]; then
+ # Fail loudly if the required file is not already present.
+ if [ ! -f "$RELAYS_FILE" ]; then
+ echo "No file found at $RELAYS_FILE"
+ exit 1
+ fi
+ return 0
+fi
+
+BACKUP_FILE="$CONFIGURATION_TEMP_DIR/relays.json"
+
if [ "$CONFIGURATION" == "Staging" ]; then
API_ENDPOINT="api.stagemole.eu"
else
API_ENDPOINT="api.mullvad.net"
fi
-if [ ! -f "$RELAYS_FILE" ]; then
- echo "Download relays file"
- curl https://"$API_ENDPOINT"/app/v1/relays -s -o "$RELAYS_FILE"
+if [ ! -f "$BACKUP_FILE" ]; then
+ echo "Downloading relays file for $CONFIGURATION"
+ curl https://"$API_ENDPOINT"/app/v1/relays -s -o "$BACKUP_FILE"
fi
+
+cp "$BACKUP_FILE" "$RELAYS_FILE"