capistrano-fiftyfive 0.9.1 → 0.10.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
2
  SHA1:
3
- metadata.gz: d3916348a87186409600372b158a754099cb4b60
4
- data.tar.gz: 95c586c5077aeee4c858260ab86db882d9a9470b
3
+ metadata.gz: e23bb6c0cd0ee5b7bdf7cbce96bc25c9c2e86a3a
4
+ data.tar.gz: 32a703d754d35f55903c9f9718f4ebade51a4598
5
5
  SHA512:
6
- metadata.gz: 314a74494bda7d2c26657abfa91906c4b4933c6f7dfc6da5a3070f5156c9bb3471351842268ca1b804c2cf64a049f202a4d9eb36741ef5934fda4107f3246fe1
7
- data.tar.gz: 482de0be4a080b7c49b45edcc8007ea15e30b543a0b400ba6e9fbdcdf19b3b8e7766deeab653d2b03e98946920077b3fb0fea0020a7acdd3ab969170d4bbd7e9
6
+ metadata.gz: 39b2ddc41c28bc51c30b84eab97ca7bdd825d86a2cf58b9b1d9b2f26c62f6e87a75dd28b478cfc0a6405c1e745abd801f88f84cb7c730e3676832dadf1333e6a
7
+ data.tar.gz: e17816da9a56350727d87c86fb504927c30c20ffe4da75ccb7d8bee8abd526a221c9e3b2fc0312a8b01520aa8499811a16141da22afe00a9bba3e9b16b6c2288
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # capistrano-fiftyfive Changelog
2
2
 
3
+ ## `0.10.0`
4
+
5
+ Add support for Ubuntu 14.04 LTS. To provision a 14.04 server, use the new `provision:14_04` task.
6
+
3
7
  ## `0.9.1`
4
8
 
5
9
  Flush console output after each line is printed. This allows deployment progress to be monitored in e.g. Jenkins.
data/README.md CHANGED
@@ -19,7 +19,7 @@ The capistrano-fiftyfive gem adds a `cap <stage> provision` task to Capistrano t
19
19
 
20
20
  The gem is named "capistrano-fiftyfive" because it is built first and foremost for serving our deployment needs here at [55 Minutes](http://55minutes.com). You'll notice that capistrano-fiftyfive is opinionated and strictly uses the following stack:
21
21
 
22
- * Ubuntu 12.04 LTS
22
+ * Ubuntu 12.04 LTS or 14.04 LTS
23
23
  * PostgreSQL
24
24
  * Unicorn
25
25
  * Nginx
@@ -121,7 +121,7 @@ Check out our [rails-starter][] project for a sample Capfile and deploy.rb.
121
121
  ## Usage
122
122
 
123
123
  The power of the capistrano-fiftyfive recipes is that they take care of the
124
- entire setup of a bare Ubuntu 12.04 server, all the way to a fully configured
124
+ entire setup of a bare Ubuntu 12.04 or 14.04 server, all the way to a fully configured
125
125
  and running Rails app on top up Unicorn, Nginx, rbenv, and PostgreSQL.
126
126
 
127
127
  ### Deploying to a new server from scratch
@@ -129,13 +129,14 @@ and running Rails app on top up Unicorn, Nginx, rbenv, and PostgreSQL.
129
129
  These steps assume you have loaded the full set of capistrano-fiftyfive
130
130
  recipes in your Capfile.
131
131
 
132
- 1. Provision an Ubuntu 12.04 VPS at your hosting provider of choice.
132
+ 1. Provision an Ubuntu 12.04 or 14.04 VPS at your hosting provider of choice.
133
133
  2. Install your public SSH key for the root user. Some providers (e.g. DigitalOcean) can do this for you automatically when you provision a new VPS.
134
134
  3. Repeat steps 1-2 for all the servers in your cluster, if you are using
135
135
  a multi-server setup (e.g. separate web, app, and database servers).
136
136
  4. Let capistrano-fiftyfive take it from here:
137
137
 
138
- cap staging provision
138
+ cap staging provision # for 12.04 LTS
139
+ cap staging provision:14_04 # for 14.04 LTS
139
140
  cap staging deploy
140
141
 
141
142
  ### Running individual tasks
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Fiftyfive
3
- VERSION = "0.9.1"
3
+ VERSION = "0.10.0"
4
4
  end
5
5
  end
@@ -7,6 +7,7 @@ require "capistrano/fiftyfive/console"
7
7
  require "sshkit/formatter/abbreviated"
8
8
  include Capistrano::Fiftyfive::DSL
9
9
 
10
+ load File.expand_path("../tasks/provision.rake", __FILE__)
10
11
  load File.expand_path("../tasks/defaults.rake", __FILE__)
11
12
  load File.expand_path("../tasks/user.rake", __FILE__)
12
13
  load File.expand_path("../tasks/aptitude.rake", __FILE__)
@@ -1,5 +1,7 @@
1
1
  fiftyfive_recipe :aptitude do
2
2
  during :provision, %w(upgrade install)
3
+ before "provision:14_04", "fiftyfive:aptitude:install_postgres_repo"
4
+ before "provision:14_04", "fiftyfive:aptitude:change_postgres_packages"
3
5
  end
4
6
 
5
7
  namespace :fiftyfive do
@@ -34,15 +36,37 @@ namespace :fiftyfive do
34
36
  end
35
37
  end
36
38
 
39
+ desc "Add the official apt repository for PostgreSQL"
40
+ task :install_postgres_repo do
41
+ privileged_on roles(:all) do |host|
42
+ _add_repository(
43
+ "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main",
44
+ :key => "https://www.postgresql.org/media/keys/ACCC4CF8.asc")
45
+ end
46
+ end
47
+
48
+ desc "Change 12.04 PostgreSQL package requirements to 14.04 versions"
49
+ task :change_postgres_packages do
50
+ packages = fetch(:fiftyfive_aptitude_packages, {})
51
+ packages = Hash[packages.map do |key, value|
52
+ [key.sub(/@ppa:pitti\/postgresql$/, ""), value]
53
+ end]
54
+ set(:fiftyfive_aptitude_packages, packages)
55
+ end
56
+
37
57
  def _already_installed?(pkg)
38
58
  test(:dpkg, "-s", pkg, "2>/dev/null", "|", :grep, "-q 'ok installed'")
39
59
  end
40
60
 
41
- def _add_repository(repo)
61
+ def _add_repository(repo, options={})
42
62
  unless _already_installed?("python-software-properties")
43
63
  _install("python-software-properties")
44
64
  end
45
- execute :"apt-add-repository", "-y", repo
65
+ execute :"apt-add-repository", "-y '#{repo}'"
66
+
67
+ if (key = options.fetch(:key, nil))
68
+ execute "wget --quiet -O - #{key} | sudo apt-key add -"
69
+ end
46
70
  end
47
71
 
48
72
  def _install(pkg)
@@ -0,0 +1,18 @@
1
+ # Define empty provision tasks.
2
+ # These will be filled in by other recipes that contribute additional
3
+ # `before` and `during` tasks.
4
+
5
+ desc "Install and set up all app prerequisites (assumes Ubuntu 12.04)"
6
+ task :provision
7
+
8
+ namespace :provision do
9
+ desc "Install and set up all app prerequisites for Ubuntu 12.04"
10
+ task :"12_04" do
11
+ invoke "provision"
12
+ end
13
+
14
+ desc "Install and set up all app prerequisites for Ubuntu 14.04"
15
+ task :"14_04" do
16
+ invoke "provision"
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-fiftyfive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-13 00:00:00.000000000 Z
11
+ date: 2014-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -128,6 +128,7 @@ files:
128
128
  - lib/capistrano/tasks/migrate.rake
129
129
  - lib/capistrano/tasks/nginx.rake
130
130
  - lib/capistrano/tasks/postgresql.rake
131
+ - lib/capistrano/tasks/provision.rake
131
132
  - lib/capistrano/tasks/rake.rake
132
133
  - lib/capistrano/tasks/rbenv.rake
133
134
  - lib/capistrano/tasks/seed.rake