momentum 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +4 -4
- data/lib/momentum/opsworks.rb +7 -2
- data/lib/momentum/version.rb +1 -1
- data/lib/tasks/ow-deploy.rake +13 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e551ddc456b077ea202e4929c18fd1d4364625f8
|
4
|
+
data.tar.gz: 8f501e1026833960b12c1592c0a8556dd6b0a6d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e1881e2817372c888ce9ada604a341c2bd4ce78cf93e1de51a3c2758b1babee73da7116af6a59d89d504aa872e4eda0c5f00bc475c06370eb30b98ce955a8c4
|
7
|
+
data.tar.gz: f3c8d38f2fcf10f6c673211886f1e1768690189bbb6a838d8b97ec98b433d8ec52768f15728d4e211e3d08462ed456523b8f1d009027d81c4b98503456147b7a
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -69,22 +69,22 @@ Zip, upload, and propagate custom cookbooks to the given stack. Or, more concise
|
|
69
69
|
# or just:
|
70
70
|
bundle exec rake ow:cookbooks:update:staging
|
71
71
|
|
72
|
-
### ow:deploy[to,aws_id,aws_secret]
|
72
|
+
### ow:deploy[to,migrate_db,aws_id,aws_secret]
|
73
73
|
|
74
74
|
Trigger an OpsWorks deploy to the given stack. By default, deploys app to all running instances of the _rails-app_ layer, or the list configured in `app_layers`. E.g.:
|
75
75
|
|
76
76
|
bundle exec rake ow:deploy[staging]
|
77
77
|
# or just:
|
78
78
|
bundle exec rake ow:deploy:staging
|
79
|
+
# if you want to trigger database migrations at the same time, add the additional flag
|
80
|
+
bundle exec rake ow:deploy:migrations[staging]
|
79
81
|
|
80
82
|
### ow:logs[to,instance,log_path,aws_id,aws_secret]
|
81
83
|
|
82
|
-
Execute a tail -f (follow) command against
|
84
|
+
Execute a tail -f (follow) command against a remote log path on the given remote OpsWorks instance and stack. The path may include wildcards. E.g.:
|
83
85
|
|
84
86
|
bundle exec rake ow:logs[staging,rails-app1,/srv/www/myapp/shared/log/staging.log]
|
85
87
|
|
86
|
-
The log path may include wildcards.
|
87
|
-
|
88
88
|
### ow:ssh[to,layer_or_instance,aws_id,aws_secret]
|
89
89
|
|
90
90
|
SSH to an OpsWorks instance. If the `layer_or_instance` argument is a layer, an online instance is chosen randomly from the layer. Otherwise, the name of an online instance is expected. E.g.:
|
data/lib/momentum/opsworks.rb
CHANGED
@@ -77,7 +77,7 @@ module Momentum::OpsWorks
|
|
77
77
|
@ow = Momentum::OpsWorks.client(aws_id, aws_secret)
|
78
78
|
end
|
79
79
|
|
80
|
-
def deploy!(stack_name, app_name = Momentum.config[:app_base_name])
|
80
|
+
def deploy!(stack_name, migrate_db = false, app_name = Momentum.config[:app_base_name])
|
81
81
|
stack = Momentum::OpsWorks.get_stack(@ow, stack_name)
|
82
82
|
app = Momentum::OpsWorks.get_app(@ow, stack, app_name)
|
83
83
|
layers = Momentum::OpsWorks.get_layers(@ow, stack, Momentum.config[:app_layers])
|
@@ -86,7 +86,12 @@ module Momentum::OpsWorks
|
|
86
86
|
@ow.create_deployment(
|
87
87
|
stack_id: stack[:stack_id],
|
88
88
|
app_id: app[:app_id],
|
89
|
-
command: {
|
89
|
+
command: {
|
90
|
+
name: 'deploy',
|
91
|
+
args: {
|
92
|
+
'migrate' => [migrate_db.to_s]
|
93
|
+
}
|
94
|
+
},
|
90
95
|
instance_ids: instance_ids
|
91
96
|
)
|
92
97
|
end
|
data/lib/momentum/version.rb
CHANGED
data/lib/tasks/ow-deploy.rake
CHANGED
@@ -14,8 +14,20 @@ namespace :ow do
|
|
14
14
|
require_credentials!(args)
|
15
15
|
deployer = Momentum::OpsWorks::Deployer.new(args[:aws_id], args[:aws_secret])
|
16
16
|
name = stack_name(args[:to])
|
17
|
-
deployment = deployer.deploy!(name)
|
17
|
+
deployment = deployer.deploy!(name, false)
|
18
18
|
$stderr.puts "Triggered deployment #{deployment[:deployment_id]} to #{name}..."
|
19
19
|
deployer.wait_for_success!(deployment)
|
20
20
|
end
|
21
|
+
|
22
|
+
namespace :deploy do
|
23
|
+
desc "Deploy to the given OpsWorks stack and tigger database migrations."
|
24
|
+
task :migrations, [:to, :aws_id, :aws_secret] do |t, args|
|
25
|
+
require_credentials!(args)
|
26
|
+
deployer = Momentum::OpsWorks::Deployer.new(args[:aws_id], args[:aws_secret])
|
27
|
+
name = stack_name(args[:to])
|
28
|
+
deployment = deployer.deploy!(name, true)
|
29
|
+
$stderr.puts "Triggered deployment #{deployment[:deployment_id]} and database migrations to #{name}..."
|
30
|
+
deployer.wait_for_success!(deployment)
|
31
|
+
end
|
32
|
+
end
|
21
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: momentum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joey Aghion
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk
|