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
|
# File 'lib/hq/engine/unlock-command.rb', line 10
def go command_name
locks =
couch.get "mandar-locks"
if locks["deploy"]
if locks["deploy"]["role"] == $deploy_role
logger.warning "unlocking deployment for role " +
"#{locks["deploy"]["role"]}"
locks["deploy"] = nil
else
logger.error "not unlocking deployment for role " +
"#{locks["deploy"]["role"]}"
end
end
locks["changes"].each do
|role, change|
next if change["state"] == "stage"
if role == $deploy_role
logger.warning "unlocking changes in state " +
"#{change["state"]} for role #{role}"
change["state"] = "stage"
else
logger.warning "not unlocking changes in state " +
"#{change["state"]} for role #{role}"
end
end
couch.update locks
end
|