aboutsummaryrefslogtreecommitdiff
path: root/scripts/azure-pipelines/osx/Get-InternalBaseBox.ps1
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2020-09-29 16:49:49 -0700
committerGitHub <noreply@github.com>2020-09-29 16:49:49 -0700
commit397d3d7188cdcd4903b0bdb33b260dde993c1424 (patch)
tree5ba335e9144ca6f6652acd19678a44daeb603077 /scripts/azure-pipelines/osx/Get-InternalBaseBox.ps1
parentb7c476bade673002cac838043b29c40bb46e1b85 (diff)
downloadvcpkg-397d3d7188cdcd4903b0bdb33b260dde993c1424.tar.gz
vcpkg-397d3d7188cdcd4903b0bdb33b260dde993c1424.zip
[vcpkg osx ci] update 2020-09-28 (#13799)
* [vcpkg osx ci] update to newer bits these ones should actually work! * update vagrantfile * correct scripts, reformat, add docs * Finish Get-InternalBaseBox, move archives In order to avoid people maliciously deleting the boxes, the archives share and file share are in different users now. * baseline libqcow to be fixed later * actually check for the mount point * fix Install-Prerequisites again * add +x to Get-InternalBaseBox.ps1 additionally, fix some errors
Diffstat (limited to 'scripts/azure-pipelines/osx/Get-InternalBaseBox.ps1')
-rwxr-xr-x[-rw-r--r--]scripts/azure-pipelines/osx/Get-InternalBaseBox.ps153
1 files changed, 41 insertions, 12 deletions
diff --git a/scripts/azure-pipelines/osx/Get-InternalBaseBox.ps1 b/scripts/azure-pipelines/osx/Get-InternalBaseBox.ps1
index 07b3f9a9b..2660ba9e1 100644..100755
--- a/scripts/azure-pipelines/osx/Get-InternalBaseBox.ps1
+++ b/scripts/azure-pipelines/osx/Get-InternalBaseBox.ps1
@@ -5,18 +5,19 @@
.SYNOPSIS
Installs the base box at the specified version from the share.
-.PARAMETER StorageAccountAccessKey
-An access key for the storage account.
+.PARAMETER FileshareMachine
+The machine which is acting as a fileshare
-.PARAMETER BaseBoxVersion
-The version of the base box to import; this should be a date, i.e. 2020-09-17
+.PARAMETER BoxVersion
+The version of the box to add. Defaults to latest if nothing is passed.
#>
-[CmdletBinding(PositionalBinding=$False)]
+[CmdletBinding()]
Param(
[Parameter(Mandatory=$True)]
- [String]$StorageAccountAccessKey,
- [Parameter(Mandatory=$True)]
- [String]$BaseBoxVersion
+ [String]$FileshareMachine,
+
+ [Parameter()]
+ [String]$BoxVersion
)
Set-StrictMode -Version 2
@@ -25,8 +26,36 @@ if (-not $IsMacOS) {
throw 'This script should only be run on a macOS host'
}
-$encodedAccessKey = [System.Web.HttpUtility]::UrlEncode($StorageAccountAccessKey)
+$mountPoint = '/Users/vcpkg/vagrant/share'
+
+if (mount | grep "on $mountPoint (") {
+ umount $mountPoint
+ if (-not $?) {
+ Write-Error "umount $mountPoint failed with return code $LASTEXITCODE."
+ throw
+ }
+}
+
+sshfs "fileshare@${FileshareMachine}:/Users/fileshare/share" $mountPoint
+if ($LASTEXITCODE -eq 1) {
+ Write-Error 'sshfs returned 1.
+This means that the osxfuse kernel extension was not allowed to load.
+Please open System Preferences > Security & Privacy > General,
+and allow the kernel extension to load.
+Then, rerun this script.
+
+If you''ve already done this, you probably need to add your ssh keys to the fileshare machine.'
+ throw
+} elseif (-not $?) {
+ Write-Error "sshfs failed with return code $LASTEXITCODE."
+ throw
+}
+
+if (-not [String]::IsNullOrEmpty($BoxVersion)) {
+ $versionArgs = @("--box-version", $BoxVersion)
+} else {
+ $versionArgs = @()
+}
+
+vagrant box add "$mountPoint/vcpkg-boxes/macos-ci.json" @versionArgs
-# TODO: finish this, once I have access to a mac again
-# mount_smbfs
-# vagrant box add