aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2020-07-31 11:52:24 -0700
committerGitHub <noreply@github.com>2020-07-31 11:52:24 -0700
commitf0ae3efbb4269a682e5732ec9d909949fed0d61d (patch)
treeb89e21f4be3951fb52fddf64a3f1ebfee166e412
parent683ec4724e14d68c31bff4795e3561275abce365 (diff)
downloadvcpkg-f0ae3efbb4269a682e5732ec9d909949fed0d61d.tar.gz
vcpkg-f0ae3efbb4269a682e5732ec9d909949fed0d61d.zip
[vcpkg-ci] fix macos setup scripts (#12639)
* [vcpkg-ci] fix macos setup scripts * the disk feature is still experimental * fix Get-InstalledVirtualBoxExtensionPacks * use new bash install script for brew instead of old-style ruby
-rw-r--r--scripts/azure-pipelines/osx/README.md2
-rwxr-xr-xscripts/azure-pipelines/osx/Setup-VagrantMachines.ps14
-rw-r--r--scripts/azure-pipelines/osx/Utilities.psm13
-rw-r--r--scripts/azure-pipelines/osx/configuration/VagrantFile24
-rw-r--r--scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json4
5 files changed, 28 insertions, 9 deletions
diff --git a/scripts/azure-pipelines/osx/README.md b/scripts/azure-pipelines/osx/README.md
index b0fdde434..0395908f0 100644
--- a/scripts/azure-pipelines/osx/README.md
+++ b/scripts/azure-pipelines/osx/README.md
@@ -25,7 +25,7 @@ and `Setup-VagrantMachines.ps1`, and make sure to push any changes!
Before anything else, one must download `brew` and `powershell`.
```sh
-$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
$ brew cask install powershell
```
diff --git a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1 b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1
index fb153a28a..5600cb1ed 100755
--- a/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1
+++ b/scripts/azure-pipelines/osx/Setup-VagrantMachines.ps1
@@ -19,7 +19,7 @@ The username for the archives share.
.PARAMETER ArchivesAccessKey
The access key for the archives share.
-.PARAMETER ArchivesUri
+.PARAMETER ArchivesUrn
The URN of the archives share; looks like `foo.windows.core.net`.
.PARAMETER ArchivesShare
@@ -105,7 +105,7 @@ $configuration = @{
archives = @{
username = $ArchivesUsername;
access_key = $ArchivesAccessKey;
- url = $ArchivesUri;
+ urn = $ArchivesUrn;
share = $ArchivesShare;
};
}
diff --git a/scripts/azure-pipelines/osx/Utilities.psm1 b/scripts/azure-pipelines/osx/Utilities.psm1
index 6fffa1522..b7ad489bb 100644
--- a/scripts/azure-pipelines/osx/Utilities.psm1
+++ b/scripts/azure-pipelines/osx/Utilities.psm1
@@ -31,7 +31,7 @@ function Get-CommandExists
[String]$Name
)
- $null -ne (Get-Command -Name $Command -ErrorAction SilentlyContinue)
+ $null -ne (Get-Command -Name $Name -ErrorAction SilentlyContinue)
}
<#
@@ -124,6 +124,7 @@ function Get-InstalledVirtualBoxExtensionPacks
$currentString = ""
$lines | ForEach-Object {
+ $Line = $_
if ($Line[0] -eq ' ') {
$currentString += "`n$($Line.Trim())"
} else {
diff --git a/scripts/azure-pipelines/osx/configuration/VagrantFile b/scripts/azure-pipelines/osx/configuration/VagrantFile
index b142b8189..1e1cce50f 100644
--- a/scripts/azure-pipelines/osx/configuration/VagrantFile
+++ b/scripts/azure-pipelines/osx/configuration/VagrantFile
@@ -29,7 +29,7 @@ devops_url = 'https://dev.azure.com/vcpkg'
agent_pool = 'vcpkgAgentPool'
pat = configuration['pat']
archives = configuration['archives']
-archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['url']}/#{archives['share']}"
+archives_url = "//#{archives['username']}:#{url_encode(archives['access_key'])}@#{archives['urn']}/#{archives['share']}"
Vagrant.configure('2') do |config|
# give them extra time to boot up
@@ -42,7 +42,25 @@ Vagrant.configure('2') do |config|
node.vm.hostname = machine[:hostname]
node.vm.synced_folder '.', '/vagrant', disabled: true
- node.vm.disk :disk, name: "#{machine[:hostname]}-data", size: "#{config['disk_size']}GB"
+ diskname = "#{machine[:hostname]}-data.vmdk"
+
+ # I don't like this, but as far as I can tell, it's the only way
+ # to do this. When vagrant finishes the `disk` feature, switch
+ # over to that -- Nicole Mazzuca
+ if (not File.exists? diskname) then
+ system "VBoxManage createmedium --filename #{diskname} --size #{1024 * 220}"
+ end
+
+ node.vm.provider 'virtualbox' do |vb|
+ vb.memory = machine[:ram]
+ vb.cpus = machine[:cpu]
+ vb.customize ['modifyvm', :id, '--ioapic', 'on']
+ vb.customize ['storageattach', :id,
+ '--storagectl', 'SATA Controller',
+ '--port', '1', '--device', '0', '--type', 'hdd',
+ '--medium', "#{diskname}"
+ ]
+ end
node.vm.provision 'shell',
run: 'once',
@@ -71,7 +89,7 @@ Vagrant.configure('2') do |config|
node.vm.provision 'shell',
run: 'once',
name: 'Install brew and xcode command line tools',
- inline: '/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"',
+ inline: '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"',
privileged: false
node.vm.provision 'shell',
diff --git a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json
index 0518df3b6..f0abc1673 100644
--- a/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json
+++ b/scripts/azure-pipelines/osx/configuration/vagrant-configuration.schema.json
@@ -34,13 +34,13 @@
"required": [
"username",
"access_key",
- "url",
+ "urn",
"share"
],
"properties": {
"username": { "type": "string" },
"access_key": { "type": "string" },
- "url": { "type": "string" },
+ "urn": { "type": "string" },
"share": { "type": "string" }
}
}