vcpkg/scripts/azure-pipelines/osx/setup-guest.sh
Billy O'Neal cf20e29526
Update macOS for January 2024 (#35617)
macOS 14.2.1 on amd64, 14.3 on arm64
XCode Console Tools 15.1

Other changes:

macOS install is done from the installers rather than from the recovery partition
readme.md is now written for a vcpkg-team audience
vagrant is removed as a dependency so that discussion of how to persist the VMs between machines could be included
arm64 is added using https://github.com/s-u/macosvm
2024-01-25 10:50:32 -08:00

21 lines
1.1 KiB
Bash

#!/bin/sh
export VM_DIRECTORY=`ls ~/Parallels | grep vcpkg-osx`
export SSH_KEY="$HOME/Parallels/$VM_DIRECTORY/id_guest"
export SSH_PUBLIC_KEY="$SSH_KEY.pub"
ssh-keygen -P '' -f "$SSH_KEY"
if [ `uname -m` = 'arm64' ]; then
# on arm64, prlctl does not know the IP address, but luckily for us DNS works
export SSH_COOKIE=vcpkg@vcpkgs-Virtual-Machine.local
else
# on amd64, DNS does not work, but luckily for us prlctl does know the IP
export GUEST_IP=`prlctl list --full | sed -nr 's/^.*running *([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}).*/\1/p'`
export SSH_COOKIE=vcpkg@$GUEST_IP
fi
echo Type 'vcpkg' and press enter
ssh-copy-id -o StrictHostKeychecking=no -i "$SSH_PUBLIC_KEY" $SSH_COOKIE
echo Keys deployed
ssh $SSH_COOKIE -o StrictHostKeychecking=no -i "$SSH_KEY" echo hello from \`hostname\`
scp -o StrictHostKeychecking=no -i "$SSH_KEY" ./setup-box.sh $SSH_COOKIE:/Users/vcpkg/setup-box.sh
ssh $SSH_COOKIE -o StrictHostKeychecking=no -i "$SSH_KEY" chmod +x /Users/vcpkg/setup-box.sh
ssh $SSH_COOKIE -o StrictHostKeychecking=no -i "$SSH_KEY" /Users/vcpkg/setup-box.sh