diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2025-03-05 15:30:00 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2025-03-11 09:38:39 +0100 |
| commit | 69f0ac41bf09191b3f5383c52fbadc06c6420f9e (patch) | |
| tree | 6a7172b3fe9971e6494487d5ce51344249ef8e50 | |
| parent | 2fa428c58a3b43010690a2c644350386e8e597f2 (diff) | |
| download | mullvadvpn-69f0ac41bf09191b3f5383c52fbadc06c6420f9e.tar.xz mullvadvpn-69f0ac41bf09191b3f5383c52fbadc06c6420f9e.zip | |
Move browser files to WORKDIR only after all fallible downloads
Fixes bug where downloading a new stable could replace the artifact in
$WORKDIR/, and then a download of the alpha could fail,
aborting the script.
but since the WORKDIR cache of stable was already replaced, subsequent
runs would not trigger a notification to the repository builder, as
the stable artifact in WORKDIR would be identical at this point.
Saving the move to WORKDIR until last prevents this hickup
| -rwxr-xr-x | ci/mullvad-browser/download-mullvad-browser.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ci/mullvad-browser/download-mullvad-browser.sh b/ci/mullvad-browser/download-mullvad-browser.sh index 66de6a5a45..956c255226 100755 --- a/ci/mullvad-browser/download-mullvad-browser.sh +++ b/ci/mullvad-browser/download-mullvad-browser.sh @@ -39,6 +39,7 @@ function main() { echo "[#] Downloading $PACKAGE_FILENAME.asc" if ! wget --quiet "$SIGNATURE_URL"; then echo "[!] Failed to download $SIGNATURE_URL" + rm "$PACKAGE_FILENAME" exit 1 fi @@ -63,8 +64,6 @@ function main() { return fi - echo "[#] $PACKAGE_FILENAME has changed" - cp "$PACKAGE_FILENAME" "$WORKDIR/" # Leaving a file in `$TMP_DIR` is used as an indicator further down that something changed } @@ -104,7 +103,13 @@ if [[ -z "$(ls -A "$TMP_DIR")" ]]; then exit fi +echo "" echo "[#] New browser build(s) exist" +for package in *; do + echo "[#] $package has changed" + mv "$package" "$WORKDIR/" +done + for repository in "${REPOSITORIES[@]}"; do inbox_dir="$NOTIFY_DIR/$repository" |
