amoeba_deploy_tools 0.0.9 → 0.0.10
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/LICENSE.txt +1 -1
- data/README.md +72 -2
- data/{amoeba-deploy-tools.gemspec → amoeba_deploy_tools.gemspec} +1 -1
- data/lib/amoeba_deploy_tools/capistrano.rb +1 -1
- data/lib/amoeba_deploy_tools/capistrano/recipes.rb +9 -8
- data/lib/amoeba_deploy_tools/capistrano/sidekiq.rb +32 -0
- data/lib/amoeba_deploy_tools/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46ec4cdaae2a986f1deb936216e40730eb91b293
|
4
|
+
data.tar.gz: 5e9dc6fbd69427688e20961a27a8c4240b14f8f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9133cddf24e41e3b34bacf49e886d87d48167d6daeabee94dbaa68a037e7c0bc5ff5f23c5406ba079b5a6a9d8814615991db2fd807f239ac03c38cf87e27ae6
|
7
|
+
data.tar.gz: 4a3d5fd6c5bc9586acc57f122887fdd19446dfe373d511335c0ec46db700817226aa063cf0ae08551bedd505cf1fa57c4299680ba377eee0511cc609af2c9e25
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -7,7 +7,7 @@ often setting up a chef "kitchen" can be tedious. Additionally, we believe in su
|
|
7
7
|
deploys. That is, we don't like to maintain and run a separate chef server just to manage our boxes.
|
8
8
|
|
9
9
|
ADT integrates a number of other tools (`chef-solo`, and `librarian`, and others) and we provide a
|
10
|
-
[skeleton Kitchen](http://github.com/
|
10
|
+
[skeleton Kitchen](http://github.com/AmoebaLabs/amoeba-kitchen-skel), so you can fork our
|
11
11
|
kitchen, install this gem, and deploy a node in minutes.
|
12
12
|
|
13
13
|
## Short introduction
|
@@ -79,5 +79,75 @@ The URL is optional, but if specified will be used as the library's git repo. Yo
|
|
79
79
|
do not already have a Kitchen you wish to use in git, but want to start a new one based on the URL
|
80
80
|
specified).
|
81
81
|
|
82
|
-
The default URL is [Amoeba's skeleton](https://github.com/
|
82
|
+
The default URL is [Amoeba's skeleton](https://github.com/AmoebaLabs/amoeba-kitchen-skel),
|
83
83
|
which will be copied (as if `--skeleton` was specified).
|
84
|
+
|
85
|
+
|
86
|
+
## Capistrano Integration
|
87
|
+
|
88
|
+
When building a node using ADT, you are expected to deploy to it using Capistrano. To make things
|
89
|
+
easier, we have included some capistrano recipies to assist with your deployment. Note that we
|
90
|
+
currently only support Capistrano 2.x, as there were significant changes in 3.x that make it
|
91
|
+
incompatible. If you use 3.x, you can still use ADT, but you'll have to symlink the database.yml
|
92
|
+
yourself (as well as figure out how to deploy your application initially). We will gladly accept a
|
93
|
+
pull request if someone wishes to share it.
|
94
|
+
|
95
|
+
For those using Capistrano 2.x, you can do the following to use ADT quickly:
|
96
|
+
|
97
|
+
First, `capify` your application, which generates a `Capfile` that basically loads `config/deploy.rb`
|
98
|
+
|
99
|
+
Add to your `config/deploy.rb` the following contents:
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
#### 3rd party recipes
|
103
|
+
require "bundler/capistrano"
|
104
|
+
require "amoeba_deploy_tools/capistrano"
|
105
|
+
|
106
|
+
#### Variables
|
107
|
+
set :application, "Your App Name"
|
108
|
+
set :repository, "[insert git:// url]"
|
109
|
+
set :scm, :git
|
110
|
+
|
111
|
+
#### We will use multi-stage to support several enviornments (in case you use more than one). Be
|
112
|
+
#### sure to include all envs you will deploy servers for (normally just QA and Production).
|
113
|
+
set :stages, %w(production qa)
|
114
|
+
set :default_stage, "qa"
|
115
|
+
|
116
|
+
require "capistrano/ext/multistage"
|
117
|
+
|
118
|
+
set :user, "yourappuser"
|
119
|
+
set :deploy_to, "/home/yourappuser"
|
120
|
+
set :deploy_via, :remote_cache
|
121
|
+
|
122
|
+
set :use_sudo, false
|
123
|
+
set :ssh_options, { forward_agent: true }
|
124
|
+
default_run_options[:pty] = true
|
125
|
+
|
126
|
+
set :branch, 'master' unless exists?(:branch)
|
127
|
+
|
128
|
+
#### Custom recipes
|
129
|
+
# Insert any custom recipes
|
130
|
+
|
131
|
+
```
|
132
|
+
|
133
|
+
### Customized Capistrano Recipes
|
134
|
+
|
135
|
+
The line that reads `require "amoeba_deploy_tools/capistrano"` will automagically symlink your
|
136
|
+
`database.yml` and allow you to run a `cap amoeba:bootstrap` command, which is used to deploy your
|
137
|
+
application for the first time.
|
138
|
+
|
139
|
+
#### amoeba:bootstrap
|
140
|
+
|
141
|
+
This is used to bootstrap a "cold" server. Run it once after you first bootstrap your server node
|
142
|
+
using ADT. It will perform the following functions:
|
143
|
+
|
144
|
+
* update
|
145
|
+
* db_setup
|
146
|
+
* migrate
|
147
|
+
* start
|
148
|
+
|
149
|
+
#### deploy:restart
|
150
|
+
|
151
|
+
The `cap deploy:restart` command is overridden by ADT so that Passenger's restart method can be used
|
152
|
+
(which doesn't require sudo or restarting a process). Instead it just touches tmp/restart.txt in the
|
153
|
+
project folder). Feel free to override this behavior if you'd like.
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = 'sayhi@amoe.ba'
|
11
11
|
s.summary = 'Easy Chef Solo / Knife operation with Amoeba Deploy Tools.'
|
12
12
|
s.description = 'Easy Chef Solo / Knife operation with Amoeba Deploy Tools.'
|
13
|
-
s.homepage = 'https://github.com/
|
13
|
+
s.homepage = 'https://github.com/AmoebaLabs/amoeba_deploy_tools'
|
14
14
|
s.license = 'MIT'
|
15
15
|
|
16
16
|
s.files = `git ls-files`.split("\n")
|
@@ -1,18 +1,17 @@
|
|
1
1
|
require 'amoeba_deploy_tools/capistrano/common'
|
2
|
+
require 'amoeba_deploy_tools/capistrano/sidekiq'
|
2
3
|
|
3
4
|
Capistrano::Configuration.instance(:must_exist).load do
|
4
5
|
_cset(:database_yml_path){ "#{shared_path}/config/database.yml" }
|
5
6
|
|
6
|
-
namespace :
|
7
|
+
namespace :amoeba do
|
7
8
|
desc 'Link the shared/config files into the current/config dir.'
|
8
9
|
task :symlink_configs, :roles => :app do
|
9
10
|
run [ "cd #{latest_release}",
|
10
11
|
"ln -nfs #{database_yml_path} config/"
|
11
12
|
].join(' && ')
|
12
13
|
end
|
13
|
-
end
|
14
14
|
|
15
|
-
namespace :deploy do
|
16
15
|
desc "create the database (and load seed data)"
|
17
16
|
task :db_setup do
|
18
17
|
run "cd #{current_path}; bundle exec rake db:setup RAILS_ENV=#{rails_env}"
|
@@ -25,13 +24,15 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
25
24
|
pending migrations, and then instead of invoking `deploy:restart', it will \
|
26
25
|
invoke `deploy:start' to fire up the application servers.
|
27
26
|
DESC
|
28
|
-
task :
|
29
|
-
update
|
30
|
-
db_setup
|
31
|
-
migrate
|
32
|
-
start
|
27
|
+
task :bootstrap do
|
28
|
+
deploy.update
|
29
|
+
amoeba.db_setup
|
30
|
+
deploy.migrate
|
31
|
+
deploy.start
|
33
32
|
end
|
33
|
+
end
|
34
34
|
|
35
|
+
namespace :deploy do
|
35
36
|
desc "restart the application (trigger passenger restart)"
|
36
37
|
task :restart, :roles => :app, :except => { :no_release => true } do
|
37
38
|
run "touch #{current_path}/tmp/restart.txt"
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Adds sidekiq tasks to capistrano. But they aren't going to be called by default in your deploy
|
2
|
+
# process. If you use capistrano, add the following to your deploy.rb (or something included by it):
|
3
|
+
#
|
4
|
+
# after "deploy:stop", "sidekiq:stop"
|
5
|
+
# after "deploy:start", "sidekiq:start"
|
6
|
+
# before "deploy:restart", "sidekiq:restart"
|
7
|
+
|
8
|
+
Capistrano::Configuration.instance.load do
|
9
|
+
namespace :sidekiq do
|
10
|
+
desc "Start sidekiq"
|
11
|
+
task :start, roles: :web do
|
12
|
+
sidekiq_processes.times do |i|
|
13
|
+
run "#{shared_path}/init/start_sidekiq #{i}"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Stop sidekiq"
|
18
|
+
task :stop, roles: :web do
|
19
|
+
sidekiq_processes.times do |i|
|
20
|
+
run "#{shared_path}/init/stop_sidekiq #{i}"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
desc "Restart sidekiq"
|
25
|
+
task :restart, roles: :web do
|
26
|
+
stop
|
27
|
+
start
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amoeba_deploy_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Jabbour
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -122,12 +122,13 @@ files:
|
|
122
122
|
- LICENSE.txt
|
123
123
|
- README.md
|
124
124
|
- Rakefile
|
125
|
-
-
|
125
|
+
- amoeba_deploy_tools.gemspec
|
126
126
|
- bin/amoeba
|
127
127
|
- lib/amoeba_deploy_tools.rb
|
128
128
|
- lib/amoeba_deploy_tools/capistrano.rb
|
129
129
|
- lib/amoeba_deploy_tools/capistrano/common.rb
|
130
130
|
- lib/amoeba_deploy_tools/capistrano/recipes.rb
|
131
|
+
- lib/amoeba_deploy_tools/capistrano/sidekiq.rb
|
131
132
|
- lib/amoeba_deploy_tools/command.rb
|
132
133
|
- lib/amoeba_deploy_tools/commands/amoeba.rb
|
133
134
|
- lib/amoeba_deploy_tools/commands/app.rb
|
@@ -148,7 +149,7 @@ files:
|
|
148
149
|
- spec/amoeba_deploy_tools/config_spec.rb
|
149
150
|
- spec/amoeba_deploy_tools/helpers_spec.rb
|
150
151
|
- spec/spec_helper.rb
|
151
|
-
homepage: https://github.com/
|
152
|
+
homepage: https://github.com/AmoebaLabs/amoeba_deploy_tools
|
152
153
|
licenses:
|
153
154
|
- MIT
|
154
155
|
metadata: {}
|