-
Notifications
You must be signed in to change notification settings - Fork 25
/
default.rb
63 lines (52 loc) · 1.49 KB
/
default.rb
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#### Begin prepare system ####
build_essential 'install compilation tools'
#### End prepare system ####
include_recipe 'vsts_agent::default'
agent1_name = "osx_#{node['hostname']}_01"
agent2_name = "osx_#{node['hostname']}_02"
agents_dir = "/Users/#{node['vsts_agent_test']['username']}/agents"
# cleanup
vsts_agent agent1_name do
vsts_token node['vsts_agent_test']['vsts_token']
action :remove
end
vsts_agent agent2_name do
vsts_token node['vsts_agent_test']['vsts_token']
action :remove
end
# Agent1
vsts_agent agent1_name do
install_dir "#{agents_dir}/#{agent1_name}"
user node['vsts_agent_test']['username']
group 'staff'
vsts_url node['vsts_agent_test']['vsts_url']
vsts_pool node['vsts_agent_test']['vsts_pool']
vsts_token node['vsts_agent_test']['vsts_token']
action :install
end
vsts_agent agent1_name do
action :restart
end
vsts_agent agent1_name do
vsts_token node['vsts_agent_test']['vsts_token']
action :remove
end
# Agent2
vsts_agent agent2_name do
install_dir "#{agents_dir}/#{agent2_name}"
user node['vsts_agent_test']['username']
group 'staff'
path '/usr/local/bin/:/usr/bin:/opt/bin/'
env('M2_HOME' => '/opt/maven', 'JAVA_HOME' => '/opt/java')
vsts_url node['vsts_agent_test']['vsts_url']
vsts_pool node['vsts_agent_test']['vsts_pool']
vsts_token node['vsts_agent_test']['vsts_token']
action :install
end
vsts_agent agent2_name do
action :restart
end
vsts_agent agent2_name do
vsts_token node['vsts_agent_test']['vsts_token']
action :remove
end