capistrano3-foreman-precogs 0.4

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 45b79011f49c586e81157e34f80a30c32e0d2136
4
+ data.tar.gz: 503366ed3d4911d14c2e0e8d629918e9fd175ef9
5
+ SHA512:
6
+ metadata.gz: b190e152eb9a437bf91fe47061f7f15cec21fe00b379425ce833c39d4e1c0290134b1ecf2cbaebb5ed8dca411511e9c2ae410819751b1c4269c581674d4d5841
7
+ data.tar.gz: ec0772b8021c74a44c44be062f92f1e7be572c425720b8ca28109e7b35c29b95c4eb2d22acbceadf5662a0b1b2785290a10623abd4cd7cb124d38c4927c68617
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .DS_Store
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ # 0.1.0
2
+
3
+ Initial release
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Stefan Surzycki
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # Capistrano::Foreman
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/capistrano3-foreman.png)](http://badge.fury.io/rb/capistrano3-foreman)
4
+
5
+ Capistrano V3 for foreman
6
+
7
+ ## WIP
8
+
9
+ There be dragons, proceed at your own risk.
10
+
11
+ ## Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ gem 'capistrano3-foreman-precogs'
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install capistrano3-foreman-precogs
24
+
25
+ ## Usage
26
+
27
+ Require in Capfile to use the default task:
28
+
29
+ require 'capistrano/foreman'
30
+
31
+
32
+ ###Export Procfile to upstart###
33
+
34
+ This task will be run before `deploy:restart` as part of Capistrano's default deploy, or can be run in isolation with:
35
+
36
+ cap production foreman:export
37
+
38
+ **NOTE**
39
+
40
+ In order for foreman to export to upstart your deploy user must have `sudoer` privileges
41
+
42
+
43
+ ###Options###
44
+
45
+ Custom ENVIRONMENT variables for foreman [(see here)](http://ddollar.github.io/foreman/#ENVIRONMENT).
46
+
47
+ set :foreman_env, '/remote/path/to/your.env' # Default none
48
+
49
+
50
+ ##The Twelve Factor App##
51
+
52
+ [(Treat backing services as attached resources)](http://12factor.net/backing-services) by using ENV variables for your configuration.
53
+
54
+ **database.yml**
55
+
56
+ default: &default
57
+ adapter: mysql2
58
+ host: <%= ENV['DATABASE_HOST'] %>
59
+ username: <%= ENV['DATABASE_USERNAME'] %>
60
+ password: <%= ENV['DATABASE_PASSWORD'] %>
61
+ encoding: utf8
62
+ reconnect: true
63
+
64
+ staging:
65
+ <<: *default
66
+ database: app_web_staging
67
+
68
+ production:
69
+ <<: *default
70
+ database: app_web_production
71
+
72
+ **deploy.rb**
73
+
74
+ set :foreman_env, '/home/deploy/.pam_environment'
75
+
76
+ **.pam_environment**
77
+
78
+ DATABASE_HOST=database.example.com
79
+ DATABASE_USERNAME=user
80
+ DATABASE_PASSWORD=password
81
+ RAILS_ENV=staging
82
+
83
+ ## Contributing
84
+
85
+ 1. Fork it
86
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
87
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
88
+ 4. Push to the branch (`git push origin my-new-feature`)
89
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano-foreman'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'capistrano3-foreman-precogs'
8
+ spec.version = Capistrano::Foreman::VERSION
9
+ spec.authors = ['Stefan Surzycki', 'Galaad Gauthier']
10
+ spec.email = ['stefan.surzycki@gmail.com']
11
+ spec.description = %q{Foreman support for Capistrano 3.x}
12
+ spec.summary = %q{Foreman support for Capistrano 3.x}
13
+ spec.homepage = 'https://github.com/Precogs-com/capistrano-foreman'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'capistrano', '~> 3.0'
22
+ spec.add_dependency 'sshkit', '>= 1.2.0'
23
+
24
+ spec.add_development_dependency 'bundler', '~> 1.3'
25
+ spec.add_development_dependency 'rake'
26
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Foreman
3
+ VERSION = '0.4'
4
+ end
5
+ end
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/foreman.cap', __FILE__)
@@ -0,0 +1,45 @@
1
+ namespace :foreman do
2
+ desc 'Export the Procfile to Ubuntu upstart scripts'
3
+ task :export do
4
+ on roles(:app) do |host|
5
+ log_path = shared_path.join('log')
6
+ environment_path = fetch(:foreman_env)
7
+ foreman_user = fetch(:foreman_export_user) || "ubuntu"
8
+
9
+ within release_path do
10
+ as :root do
11
+ execute :bundle, "exec foreman export upstart /etc/init -a #{fetch(:application)} -u #{foreman_user} -l #{log_path} -e #{environment_path}"
12
+ end
13
+ end
14
+ end
15
+ end
16
+
17
+ desc 'Start the application services'
18
+ task :start do
19
+ on roles(:app) do |host|
20
+ as :root do
21
+ execute :start, fetch(:application)
22
+ end
23
+ end
24
+ end
25
+
26
+ desc 'Stop the application services'
27
+ task :stop do
28
+ on roles(:app) do |host|
29
+ as :root do
30
+ execute :stop, fetch(:application)
31
+ end
32
+ end
33
+ end
34
+
35
+ desc 'Restart the application services'
36
+ task :restart do
37
+ on roles(:app) do |host|
38
+ as :root do
39
+ execute :service, "#{fetch(:application)} start || service #{fetch(:application)} restart"
40
+ end
41
+ end
42
+ end
43
+
44
+ before 'deploy:publishing', 'foreman:export'
45
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano3-foreman-precogs
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.4'
5
+ platform: ruby
6
+ authors:
7
+ - Stefan Surzycki
8
+ - Galaad Gauthier
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2016-01-27 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: capistrano
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: '3.0'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ version: '3.0'
28
+ - !ruby/object:Gem::Dependency
29
+ name: sshkit
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '>='
33
+ - !ruby/object:Gem::Version
34
+ version: 1.2.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '>='
40
+ - !ruby/object:Gem::Version
41
+ version: 1.2.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: bundler
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ~>
47
+ - !ruby/object:Gem::Version
48
+ version: '1.3'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: '1.3'
56
+ - !ruby/object:Gem::Dependency
57
+ name: rake
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ description: Foreman support for Capistrano 3.x
71
+ email:
72
+ - stefan.surzycki@gmail.com
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .gitignore
78
+ - CHANGELOG.md
79
+ - Gemfile
80
+ - LICENSE.txt
81
+ - README.md
82
+ - Rakefile
83
+ - capistrano3-foreman-precogs.gemspec
84
+ - lib/capistrano-foreman.rb
85
+ - lib/capistrano/foreman.rb
86
+ - lib/capistrano/tasks/foreman.cap
87
+ homepage: https://github.com/Precogs-com/capistrano-foreman
88
+ licenses:
89
+ - MIT
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - '>='
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - '>='
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.0.14
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Foreman support for Capistrano 3.x
111
+ test_files: []