ops_worker 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/ops_worker +2 -1
- data/lib/ops_worker/app.rb +19 -0
- data/lib/ops_worker/version.rb +1 -1
- metadata +1 -1
data/bin/ops_worker
CHANGED
data/lib/ops_worker/app.rb
CHANGED
@@ -43,6 +43,10 @@ module OpsWorker
|
|
43
43
|
def deploy(revision = nil)
|
44
44
|
OpsWorker.logger.info {"Deploying app #{@name} from #{revision || @revision}"}
|
45
45
|
|
46
|
+
if deploying?
|
47
|
+
raise StandardError.new("#{@name} is already deploying")
|
48
|
+
end
|
49
|
+
|
46
50
|
existing_revision = @revision.dup()
|
47
51
|
changing_revisions = revision && revision != existing_revision
|
48
52
|
|
@@ -108,6 +112,21 @@ module OpsWorker
|
|
108
112
|
DeploymentStatus.new(result[:deployment_id], @opsworks_client)
|
109
113
|
end
|
110
114
|
|
115
|
+
# This is a best-efforts way to check if the current system is deploying by seeing if there is a deployment in
|
116
|
+
# progress that is running
|
117
|
+
def deploying?
|
118
|
+
deployments = @opsworks_client.describe_deployments(:app_id => @id)[:deployments]
|
119
|
+
if deployments.length > 0
|
120
|
+
latest_deployment = deployments.first
|
121
|
+
|
122
|
+
if latest_deployment[:status] == "running"
|
123
|
+
return true
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
false
|
128
|
+
end
|
129
|
+
|
111
130
|
def app_server_instances
|
112
131
|
online_instances().select do |i|
|
113
132
|
i.layers.any? {|l| l.type == "rails-app" || l.type == "custom"}
|
data/lib/ops_worker/version.rb
CHANGED