capistrano-hivequeen 7.3.0 → 7.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3a355f7202bb514227995dec097d993eb05c4d38
4
- data.tar.gz: 2b3aa039a7fe4de40236222cd93e89c9d4a3c24e
2
+ SHA256:
3
+ metadata.gz: 501195df16e5bf37fcbfd70296ba9241a784f7d56670baf7722f6b627ecce049
4
+ data.tar.gz: 1c684d9f8f7bd13a28a11d21e987b73f972cadd50f8374599bbcf68a81c6f5e4
5
5
  SHA512:
6
- metadata.gz: caf489625de608b6e7140f08cc9c68755a64ddc143ac5f2cdc9d9a41d5cd3e9f0f40ad84a43ae2e9a6ca3dbd90d137388bc6e7e3179ee8c087fafcb153ff4cfd
7
- data.tar.gz: d56bdd9f5e72c15dda5a15159ca8021e04ac1f9f980ec3c9fe62314ddf5216f223c434c9819f0eee1905807ad537e80bf1893046824d65acb6171f7e2aa45545
6
+ metadata.gz: 8e45901e1a5a9968f4b0703a88cabfc7733a9959177321a860c00f35e3492d702b51454a5353c593573e6a35396d6e5a15611bbe7486fe8c597f0acf4523d3ea
7
+ data.tar.gz: '09c60243c11e62f0f8bbc5d2d7ae4d95e8795c5fbe0039f4c1d338ba2b0a41caa8f3f5d04d22cbda30d81f69db7c328d8c9bfddfb237ff986f29e075609348b4'
data/README.rdoc CHANGED
@@ -26,3 +26,15 @@ And in your config/deploy.rb:
26
26
  Use a specific branch, rather than the default for the Hivequeen environment:
27
27
 
28
28
  cap staging deploy -s branch=some_feature
29
+
30
+ === Releasing a new version
31
+ First, bump the version in lib/capistrano/hivequeen/version.rb. Then:
32
+
33
+ gem build capistrano-hivequeen.gemspec
34
+ gem push capistrano-hivequeen-$VERSION.gem
35
+
36
+ == License
37
+
38
+ @copy; Copyright Kickstarter, PBC.
39
+
40
+ Released under an MIT License.
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.name = 'capistrano-hivequeen'
11
11
  s.version = HiveQueen::Version.to_s
12
12
  s.date = Time.now.strftime("%Y-%m-%d")
13
+ s.license = 'MIT'
13
14
 
14
15
  ## Make sure your summary is short. The description may be as long
15
16
  ## as you like.
@@ -15,6 +15,9 @@ Capistrano::Configuration.instance(:must_exist).load do
15
15
  # From the command line, use -s override=true to force a deployment
16
16
  set :override, false
17
17
 
18
+ # Don't mark deployments as canary deployments by default
19
+ set :canary, false
20
+
18
21
  # Command to get the changes being deployed
19
22
  set :changelog_command do
20
23
  `git log #{current_commit}...#{real_revision} --pretty="%n%h %an: %s (%ar)" --stat --no-color`
@@ -75,7 +78,7 @@ Capistrano::Configuration.instance(:must_exist).load do
75
78
  if exists?(:az)
76
79
  servers = servers.select {|s| s['availability_zone'] == az}
77
80
  end
78
- role(role_name.to_sym) { servers.map {|s| s['public_dns']} }
81
+ role(role_name.to_sym) { servers.map {|s| s['public_dns'] || s['private_dns']} }
79
82
  end
80
83
 
81
84
  # Ensure some server designated as db server
@@ -7,6 +7,8 @@ Capistrano::Configuration.instance.load do
7
7
  before "deploy:stage", "hivequeen:start"
8
8
  before 'hivequeen:start', 'hivequeen:check_commit'
9
9
  on :start, "hivequeen:require_environment", :except => HiveQueen.environment_names
10
+ on :start, "hivequeen:ensure_canary_specifies_hosts"
11
+
10
12
  namespace :hivequeen do
11
13
 
12
14
  desc "[internal] abort if no environment specified"
@@ -14,6 +16,14 @@ Capistrano::Configuration.instance.load do
14
16
  abort "No environment specified." if !exists?(:environment)
15
17
  end
16
18
 
19
+ desc "[internal] abort if we're trying to do a canary deploy but HOSTS hasn't been defined"
20
+ task :ensure_canary_specifies_hosts do
21
+ # TODO: I suppose we could randomly select instance(s) in this case
22
+ if canary && !ENV.key?('HOSTS')
23
+ abort "You asked to do a canary deployment but didn't specify any hosts! \nPlease invoke like `cap HOSTS=foo.com deploy -s canary=true'"
24
+ end
25
+ end
26
+
17
27
  desc "[internal] Start a deployment in hivequeen"
18
28
  task :start do
19
29
  # TODO: is there a better way to determine what cap tasks are running?
@@ -22,7 +32,8 @@ Capistrano::Configuration.instance.load do
22
32
  params = {
23
33
  :task => tasks.join(' '),
24
34
  :commit => real_revision,
25
- :override => override
35
+ :override => override,
36
+ :canary => canary,
26
37
  }
27
38
 
28
39
  if current_commit
@@ -44,7 +55,7 @@ Capistrano::Configuration.instance.load do
44
55
 
45
56
  desc "[internal] Prompt if deploying the currently running commit, or if tests haven't passed"
46
57
  task :check_commit do
47
- if environment.to_s == 'production' && !override
58
+ if environment.to_s == 'production' && !override && !canary
48
59
  if current_commit == real_revision
49
60
  banner = %q{
50
61
  ______ _ _ _ ___
@@ -111,8 +122,12 @@ Capistrano::Configuration.instance.load do
111
122
  end
112
123
 
113
124
  desc "restarts all rails services concurrently"
114
- task :restart do
115
- run "if [ -x /etc/init.d/rails_services ]; then /etc/init.d/rails_services upgrade; fi"
125
+ task :restart, max_hosts: 3 do
126
+ restart_cmd = "if [ -x /etc/init.d/rails_services ]; then /etc/init.d/rails_services upgrade; fi"
127
+ # Restart non-app servers all-at-once
128
+ run restart_cmd, roles: (roles.keys - [:app])
129
+ # Restart app servers in batchs of 3
130
+ run restart_cmd, max_hosts: 10, roles: :app
116
131
  end
117
132
  end
118
133
 
@@ -1,6 +1,6 @@
1
1
  class HiveQueen
2
2
  class Version
3
- @@version = '7.3.0'
3
+ @@version = '7.6.0'
4
4
 
5
5
  def self.to_s
6
6
  @@version
@@ -1,5 +1,6 @@
1
1
  # HTTP Client for Hive Queen environment configuration
2
2
  require 'json'
3
+ require 'active_support'
3
4
  require 'active_support/core_ext'
4
5
  require 'fileutils'
5
6
  require 'excon'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-hivequeen
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.3.0
4
+ version: 7.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Suggs
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-28 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -97,9 +97,10 @@ files:
97
97
  - lib/capistrano/hivequeen/setup.rb
98
98
  - lib/capistrano/hivequeen/version.rb
99
99
  homepage: http://github.com/kickstarter/capistrano-hivequeen
100
- licenses: []
100
+ licenses:
101
+ - MIT
101
102
  metadata: {}
102
- post_install_message:
103
+ post_install_message:
103
104
  rdoc_options:
104
105
  - "--charset=UTF-8"
105
106
  require_paths:
@@ -115,9 +116,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
116
  - !ruby/object:Gem::Version
116
117
  version: '0'
117
118
  requirements: []
118
- rubyforge_project:
119
- rubygems_version: 2.2.2
120
- signing_key:
119
+ rubygems_version: 3.0.3
120
+ signing_key:
121
121
  specification_version: 2
122
122
  summary: Capistrano extensions for interacting with HiveQueen
123
123
  test_files: []