-
Notifications
You must be signed in to change notification settings - Fork 384
/
Copy pathrun-build-and-upload.sh
26 lines (21 loc) · 1.13 KB
/
run-build-and-upload.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
# Buildscript to run on our buildserver to create and upload an iOS app.
#
# The script expects two tart VMs, `ios-build` and `ios-upload` to exist and be
# executable. The build VM is expected to have the appropriate environment to
# be able to build the app and the upload VM - to upload the app. Both must be
# reachable via SSH without a password via the SSH key located in
# ~/.ssh/ios-vm-key.
set -eu -o pipefail
# Add SSH key for iOS build VMs to be able to SSH into them without user interaction
eval "$(ssh-agent)"
ssh-add ~/.ssh/ios-vm-key
# This single path really screws with XCode and wireguard-go's makefiles, which
# really do not like the whitespace. Thus, the build source is copied to a
# non-whitespaced `~/build`, built there and the resulting `MullvadVPN.ipa` is
# copied back.
MULLVAD_CHECKOUT_DIR="${MULLVAD_CHECKOUT_DIR:-mullvadvpn-app}"
bash run-in-vm.sh "ios-build" "$(pwd)/build-app.sh" "build:${MULLVAD_CHECKOUT_DIR}"
mkdir -p build-output
cp "${MULLVAD_CHECKOUT_DIR}/ios/Build/MullvadVPN.ipa" build-output/MullvadVPN.ipa
bash run-in-vm.sh "ios-upload" "$(pwd)/upload-app.sh" "build-output:build-output"