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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdb4ecdd5ff63a3f4dee9e0b6f59510ff08d4cdf
4
- data.tar.gz: e5c9d2514ae33d2498bad33cc71eb30fa77097a6
3
+ metadata.gz: e551ddc456b077ea202e4929c18fd1d4364625f8
4
+ data.tar.gz: 8f501e1026833960b12c1592c0a8556dd6b0a6d9
5
5
  SHA512:
6
- metadata.gz: 9e5a6338495a01641e31ad6495f5cb0a2b398d8992d8ab736abc11a696198b49c0b0ea507a7d1e000682f6f981e450d3d9c0e31b75fb9d05b901b1b35aaf0d3d
7
- data.tar.gz: fd59403309567ade6b47ee5bbe9cd634b5a3000277a3b38a35d0d13cf144d10ea5d7e99d820fb90b2aa5223c58f571d324ae8de124913355bee79a17fc2fc3c6
6
+ metadata.gz: 3e1881e2817372c888ce9ada604a341c2bd4ce78cf93e1de51a3c2758b1babee73da7116af6a59d89d504aa872e4eda0c5f00bc475c06370eb30b98ce955a8c4
7
+ data.tar.gz: f3c8d38f2fcf10f6c673211886f1e1768690189bbb6a838d8b97ec98b433d8ec52768f15728d4e211e3d08462ed456523b8f1d009027d81c4b98503456147b7a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 0.0.9 (2014-03-13)
2
+ -----
3
+
4
+ * Add `ow:deploy:migrations` sub-task - [@ibussieres](https://github.com/ibussieres)
5
+
1
6
  0.0.8 (2014-02-14)
2
7
  -----
3
8
 
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 an error or access log file on the given remote OpsWorks stack. Default log is 'ssl-error'. Chooses an instance of the _rails-app_ layer. E.g.:
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.:
@@ -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: { name: 'deploy' },
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
@@ -1,3 +1,3 @@
1
1
  module Momentum
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -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.8
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-02-14 00:00:00.000000000 Z
11
+ date: 2014-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk