2020-09-25 06:15:06 +08:00
|
|
|
server = {
|
2023-09-15 05:02:46 +08:00
|
|
|
:machine_name => 'vcpkg-eg-mac-11',
|
|
|
|
:box => 'vcpkg-macos-2023-09-11',
|
|
|
|
:box_version => '0',
|
2022-02-10 05:25:57 +08:00
|
|
|
:ram => 24000,
|
2023-09-15 05:02:46 +08:00
|
|
|
:cpu => 12
|
2020-09-25 06:15:06 +08:00
|
|
|
}
|
|
|
|
|
2023-09-15 05:02:46 +08:00
|
|
|
azure_agent_url = 'https://vstsagentpackage.azureedge.net/agent/3.225.0/vsts-agent-osx-x64-3.225.0.tar.gz'
|
|
|
|
devops_url = 'https://dev.azure.com/vcpkg'
|
|
|
|
agent_pool = 'PrOsx-2023-09-11'
|
|
|
|
pat = '<replace with PAT>'
|
2020-09-25 06:15:06 +08:00
|
|
|
|
|
|
|
Vagrant.configure('2') do |config|
|
|
|
|
config.vm.box = server[:box]
|
|
|
|
config.vm.box_version = server[:box_version]
|
|
|
|
config.vm.synced_folder '.', '/vagrant', disabled: true
|
|
|
|
|
2021-04-29 22:39:04 +08:00
|
|
|
config.vm.provider 'parallels' do |prl|
|
|
|
|
prl.memory = server[:ram]
|
|
|
|
prl.cpus = server[:cpu]
|
2020-09-25 06:15:06 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.provision 'shell',
|
|
|
|
run: 'once',
|
2021-04-29 22:39:04 +08:00
|
|
|
name: 'Create the data directory',
|
|
|
|
inline: "mkdir ~/Data",
|
2020-09-25 06:15:06 +08:00
|
|
|
privileged: false
|
|
|
|
|
|
|
|
config.vm.provision 'shell',
|
|
|
|
run: 'once',
|
|
|
|
name: 'Download azure agent',
|
|
|
|
inline: "curl -s -o ~/Downloads/azure-agent.tar.gz #{azure_agent_url}",
|
|
|
|
privileged: false
|
|
|
|
|
|
|
|
config.vm.provision 'shell',
|
|
|
|
run: 'once',
|
|
|
|
name: 'Unpack azure agent',
|
|
|
|
inline: 'mkdir myagent; cd myagent; tar xf ~/Downloads/azure-agent.tar.gz',
|
|
|
|
privileged: false
|
|
|
|
|
|
|
|
config.vm.provision 'shell',
|
|
|
|
run: 'once',
|
|
|
|
name: 'Add VM to azure agent pool',
|
|
|
|
inline: "cd ~/myagent;\
|
|
|
|
./config.sh --unattended \
|
|
|
|
--url #{devops_url} \
|
|
|
|
--work ~/Data/work \
|
|
|
|
--auth pat --token #{pat} \
|
|
|
|
--pool #{agent_pool} \
|
2022-01-11 08:08:51 +08:00
|
|
|
--agent #{server[:machine_name]} \
|
2020-09-25 06:15:06 +08:00
|
|
|
--replace \
|
|
|
|
--acceptTeeEula",
|
|
|
|
privileged: false
|
|
|
|
|
|
|
|
# Start listening for jobs
|
|
|
|
config.vm.provision 'shell',
|
|
|
|
run: 'always',
|
|
|
|
name: 'Start running azure pipelines',
|
|
|
|
inline: 'cd /Users/vagrant/myagent;\
|
|
|
|
nohup ./run.sh&',
|
|
|
|
privileged: false
|
|
|
|
end
|