mascherano 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/README.md +6 -2
- data/lib/mascherano/auth_basic.rb +1 -0
- data/lib/mascherano/tasks/auth_basic.cap +26 -0
- data/lib/mascherano/tasks/foreman.cap +10 -7
- data/lib/mascherano/version.rb +1 -1
- metadata +7 -19
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZjhmZDVkMTczM2ZkYzkwMjVjZDdhZmI1MjEzYWFiZThmNmFjNWZkMA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
MjhhMzJjYWQzMmU5NzcxNTFkYzBkODFjYzVjMTQwOTBiOWQ3ZjYxMQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NjBmMmY3MTJhNTJhYTk4YWVkYzcxOWM1OTM1NGU5ZTNhNDRjNjczZGE5NmQy
|
10
|
+
Y2QwNGFkNjBhOTIyODk3MzM1MGRjY2E0ZDczNDNjYWY0OWU2MzQ1NmQ0Y2Ux
|
11
|
+
MzQ0ZjViMTgzYzFiYjcwMTk1YjM2YTIzNDU1MjljNzAxZjI3ZDA=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZTM2NWVkZmUxZDdkNjYzZDVhODk5ZmViODQyZjkzYjFlNGU1MGU2MWRmNzBk
|
14
|
+
YzUzZTBhNzI3ODNkZTZjZDQ3YmZkZmEyN2RiMjFhZGI5ODhiYmQzNjNlNzM5
|
15
|
+
YjYyYmVlY2JjODliZGIwMGI2NjgxYWVkMTZmMTgxMzQ1MmUzYWU=
|
data/README.md
CHANGED
@@ -37,13 +37,13 @@ Mascherano currently have several recipes:
|
|
37
37
|
| __upstart__ | Manage application management using Upstart |
|
38
38
|
| __token__ | Manage and generate random secret token |
|
39
39
|
| __passenger__ | Manage Pushion Passenger based application |
|
40
|
+
| __auth_basic__ | Manage and generate HTTP basic authentication `.htpasswd` |
|
40
41
|
| _more to come_ | _pull request are welcome ;)_ |
|
41
42
|
|
42
43
|
This package also provides a `noscm` recipe for when you don't need source code on your deployment box (usually application already compiled).
|
43
44
|
|
44
45
|
```ruby
|
45
46
|
# deploy.rb
|
46
|
-
set :application, 'mascherano'
|
47
47
|
set :scm, :noscm
|
48
48
|
```
|
49
49
|
## Usage
|
@@ -52,10 +52,13 @@ Make sure you have `Capfile` in the root of your project, so you can add these l
|
|
52
52
|
|
53
53
|
```ruby
|
54
54
|
require 'mascherano/env'
|
55
|
-
require 'mascherano/figaro'
|
56
55
|
require 'mascherano/foreman'
|
56
|
+
require 'mascherano/figaro'
|
57
57
|
require 'mascherano/go'
|
58
58
|
require 'mascherano/upstart'
|
59
|
+
require 'mascherano/token'
|
60
|
+
require 'mascherano/passenger'
|
61
|
+
require 'mascherano/auth_basic'
|
59
62
|
```
|
60
63
|
|
61
64
|
Then on `config/deploy/{env}.rb` you can customize the options:
|
@@ -63,6 +66,7 @@ Then on `config/deploy/{env}.rb` you can customize the options:
|
|
63
66
|
```ruby
|
64
67
|
set :env_file, '.staging.env'
|
65
68
|
set :foreman_procfile, -> { release_path.join('procfiles', 'staging') }
|
69
|
+
set :foreman_pids, -> { shared_path.join('pids') }
|
66
70
|
```
|
67
71
|
|
68
72
|
See the `lib/mascherano/task/*.cap` for more options.
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/auth_basic.cap', __FILE__)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
namespace :auth_basic do
|
2
|
+
desc 'Generate HTTP basic authentication'
|
3
|
+
task :generate do
|
4
|
+
puts "Please type the password for HTTP basic authentication, press ENTER when you're finished:"
|
5
|
+
passwd = $stdin.gets.chomp
|
6
|
+
htpasswd = nil
|
7
|
+
|
8
|
+
run_locally do
|
9
|
+
htpasswd = execute(:htpasswd, '-nb', fetch(:auth_basic_user), passwd).stdout
|
10
|
+
htpasswd.chomp!
|
11
|
+
end
|
12
|
+
|
13
|
+
on roles(fetch(:auth_basic_roles)) do
|
14
|
+
upload! StringIO.new(htpasswd), fetch(:auth_basic_target)
|
15
|
+
execute :chmod, 'o+r', fetch(:auth_basic_target)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
namespace :load do
|
21
|
+
task :defaults do
|
22
|
+
set :auth_basic_user, 'root'
|
23
|
+
set :auth_basic_roles, :all
|
24
|
+
set :auth_basic_target, -> { shared_path.join('.htpasswd') }
|
25
|
+
end
|
26
|
+
end
|
@@ -4,6 +4,7 @@ namespace :foreman do
|
|
4
4
|
|
5
5
|
You can override any of these defaults by setting the variables shown below.
|
6
6
|
|
7
|
+
set :foreman_cmd, "foreman"
|
7
8
|
set :foreman_format, "upstart"
|
8
9
|
set :foreman_location, "/etc/init"
|
9
10
|
set :foreman_port, 5000
|
@@ -12,7 +13,7 @@ namespace :foreman do
|
|
12
13
|
set :foreman_app, -> { fetch(:application) }
|
13
14
|
set :foreman_user, -> { fetch(:user) }
|
14
15
|
set :foreman_log, -> { shared_path.join('log') }
|
15
|
-
set :foreman_pids,
|
16
|
+
set :foreman_pids, false
|
16
17
|
set :foreman_concurrency, false
|
17
18
|
set :foreman_sudo, false
|
18
19
|
set :foreman_roles, :all
|
@@ -21,8 +22,9 @@ namespace :foreman do
|
|
21
22
|
task :export do
|
22
23
|
on roles(fetch(:foreman_roles)) do
|
23
24
|
within release_path do
|
24
|
-
concurrency
|
25
|
-
|
25
|
+
concurrency = fetch(:foreman_concurrency)
|
26
|
+
foreman_sudo = fetch(:foreman_sudo)
|
27
|
+
foreman_pids = fetch(:foreman_pids)
|
26
28
|
|
27
29
|
args = [fetch(:foreman_format), fetch(:foreman_location)]
|
28
30
|
args << %Q(-f #{fetch(:foreman_procfile)})
|
@@ -31,12 +33,12 @@ namespace :foreman do
|
|
31
33
|
args << %Q(-a #{fetch(:foreman_app)})
|
32
34
|
args << %Q(-u #{fetch(:foreman_user)})
|
33
35
|
args << %Q(-l #{fetch(:foreman_log)})
|
34
|
-
args << %Q(-r #{fetch(:foreman_pids)})
|
36
|
+
args << %Q(-r #{fetch(:foreman_pids)}) if foreman_pids
|
35
37
|
args << %Q(-c #{concurrency}) if concurrency
|
36
38
|
|
37
|
-
cmd = "
|
39
|
+
cmd = "#{fetch(:foreman_cmd)} export #{args.join(' ')}"
|
38
40
|
|
39
|
-
if
|
41
|
+
if foreman_sudo
|
40
42
|
execute "sudo su - -c '#{cmd}'"
|
41
43
|
else
|
42
44
|
execute cmd
|
@@ -48,6 +50,7 @@ end
|
|
48
50
|
|
49
51
|
namespace :load do
|
50
52
|
task :defaults do
|
53
|
+
set :foreman_cmd, "foreman"
|
51
54
|
set :foreman_format, "upstart"
|
52
55
|
set :foreman_location, "/etc/init"
|
53
56
|
set :foreman_port, 5000
|
@@ -56,7 +59,7 @@ namespace :load do
|
|
56
59
|
set :foreman_app, -> { fetch(:application) }
|
57
60
|
set :foreman_user, -> { fetch(:user) }
|
58
61
|
set :foreman_log, -> { shared_path.join('log') }
|
59
|
-
set :foreman_pids,
|
62
|
+
set :foreman_pids, false
|
60
63
|
set :foreman_concurrency, false
|
61
64
|
set :foreman_sudo, false
|
62
65
|
set :foreman_roles, :all
|
data/lib/mascherano/version.rb
CHANGED
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mascherano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Alif Rachmawadi
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-22 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: capistrano
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: bundler
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ~>
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ~>
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rake
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -75,11 +68,13 @@ files:
|
|
75
68
|
- lib/capistrano/noscm.rb
|
76
69
|
- lib/capistrano/tasks/noscm.cap
|
77
70
|
- lib/mascherano.rb
|
71
|
+
- lib/mascherano/auth_basic.rb
|
78
72
|
- lib/mascherano/env.rb
|
79
73
|
- lib/mascherano/figaro.rb
|
80
74
|
- lib/mascherano/foreman.rb
|
81
75
|
- lib/mascherano/go.rb
|
82
76
|
- lib/mascherano/passenger.rb
|
77
|
+
- lib/mascherano/tasks/auth_basic.cap
|
83
78
|
- lib/mascherano/tasks/env.cap
|
84
79
|
- lib/mascherano/tasks/figaro.cap
|
85
80
|
- lib/mascherano/tasks/foreman.cap
|
@@ -94,32 +89,25 @@ files:
|
|
94
89
|
homepage: https://github.com/subosito/mascherano
|
95
90
|
licenses:
|
96
91
|
- MIT
|
92
|
+
metadata: {}
|
97
93
|
post_install_message:
|
98
94
|
rdoc_options: []
|
99
95
|
require_paths:
|
100
96
|
- lib
|
101
97
|
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
-
none: false
|
103
98
|
requirements:
|
104
99
|
- - ! '>='
|
105
100
|
- !ruby/object:Gem::Version
|
106
101
|
version: '0'
|
107
|
-
segments:
|
108
|
-
- 0
|
109
|
-
hash: -3389475692804839278
|
110
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
-
none: false
|
112
103
|
requirements:
|
113
104
|
- - ! '>='
|
114
105
|
- !ruby/object:Gem::Version
|
115
106
|
version: '0'
|
116
|
-
segments:
|
117
|
-
- 0
|
118
|
-
hash: -3389475692804839278
|
119
107
|
requirements: []
|
120
108
|
rubyforge_project:
|
121
|
-
rubygems_version: 1.
|
109
|
+
rubygems_version: 2.1.9
|
122
110
|
signing_key:
|
123
|
-
specification_version:
|
111
|
+
specification_version: 4
|
124
112
|
summary: Capistrano 3.x recipes
|
125
113
|
test_files: []
|