capifig 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 05d77fa82646a8d2a2ae53b5d61979631e99af3b
4
+ data.tar.gz: a0b880dad3d951bfb657605075fbedfd44f21118
5
+ SHA512:
6
+ metadata.gz: 45420dd9d284acd5913afb3252ba01844ed01c6164d63a4496cf580929309091bb15bf98c526bf2171b23e4baa834ea17ecb6d5dc0ea3e32cd3300ae0bfba82c
7
+ data.tar.gz: ec243a230a3f4e5f4cca664f0a03c959692371a6e821133ddfe7011e5e72135d0e34668403b47d1e07e57950e3559076d3a1844aab1e7217470699a8b113b86e
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .bundle
4
4
  .config
5
5
  .yardoc
6
- Gemfile.lock
7
6
  InstalledFiles
8
7
  _yardoc
9
8
  coverage
@@ -1,12 +1,10 @@
1
1
  language: ruby
2
- bundler_args: --without development
3
2
  script: "bundle exec rspec"
4
3
  env:
5
4
  - CI=true
6
5
  rvm:
7
- - 1.9.2
8
- - 1.9.3
6
+ - 2.2.0
9
7
  notifications:
10
8
  recipients:
11
- - ralf@embarkmobile.com
9
+ - ralf@journeyapps.com
12
10
 
data/Gemfile CHANGED
@@ -3,6 +3,8 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in capifig.gemspec
4
4
  gemspec
5
5
 
6
+ gem 'capistrano', '~> 2.15'
7
+
6
8
  group :test do
7
9
  gem 'rspec'
8
10
  end
@@ -0,0 +1,45 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ capifig (0.0.2)
5
+ capistrano (>= 2.0.0)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ capistrano (2.15.5)
11
+ highline
12
+ net-scp (>= 1.0.0)
13
+ net-sftp (>= 2.0.0)
14
+ net-ssh (>= 2.0.14)
15
+ net-ssh-gateway (>= 1.1.0)
16
+ diff-lcs (1.2.5)
17
+ highline (1.7.2)
18
+ net-scp (1.2.1)
19
+ net-ssh (>= 2.6.5)
20
+ net-sftp (2.1.2)
21
+ net-ssh (>= 2.6.5)
22
+ net-ssh (2.9.2)
23
+ net-ssh-gateway (1.2.0)
24
+ net-ssh (>= 2.6.5)
25
+ rspec (3.3.0)
26
+ rspec-core (~> 3.3.0)
27
+ rspec-expectations (~> 3.3.0)
28
+ rspec-mocks (~> 3.3.0)
29
+ rspec-core (3.3.0)
30
+ rspec-support (~> 3.3.0)
31
+ rspec-expectations (3.3.0)
32
+ diff-lcs (>= 1.2.0, < 2.0)
33
+ rspec-support (~> 3.3.0)
34
+ rspec-mocks (3.3.0)
35
+ diff-lcs (>= 1.2.0, < 2.0)
36
+ rspec-support (~> 3.3.0)
37
+ rspec-support (3.3.0)
38
+
39
+ PLATFORMS
40
+ ruby
41
+
42
+ DEPENDENCIES
43
+ capifig!
44
+ capistrano (~> 2.15)
45
+ rspec
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Deploy different configuration per stage with Capistrano (with the multi-stage extension).
4
4
 
5
- The 0.0.x releases of this gem are unstable, and the API/usage may change significantly, even in minor version
5
+ The 0.x releases of this gem are unstable, and the API/usage may change significantly, even in minor version
6
6
  increments.
7
7
 
8
8
  ## Installation
@@ -11,21 +11,21 @@ Add this line to your application's Gemfile:
11
11
 
12
12
  gem 'capifig'
13
13
 
14
- Add the following line to your Capistrano deploy.rb:
14
+ ### Capistrano 3
15
+
16
+ Add the following line to your Capistrano `config/deploy.rb`:
15
17
 
16
18
  require 'capifig/capistrano'
17
19
 
20
+ ### Capistrano 2
21
+
22
+ Add the following line to your Capistrano Capfile:
23
+
24
+ require 'capifig/capistrano3'
25
+
18
26
  ## Usage
19
27
 
20
28
  For each stage, create a folder in `config/deploy/<stage>`, containing all the config files specific to that
21
29
  stage. On deployment (after deploy:update_code), these files will be copied to your app's root. Subfolders may be used,
22
30
  but must already exist on the server. For example, if you have a folder `config/deploy/production/dbconfig`, you
23
31
  also need a folder `dbconfig` in the root of your app.
24
-
25
- ## Contributing
26
-
27
- 1. Fork it
28
- 2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
31
- 5. Create new Pull Request
@@ -0,0 +1,3 @@
1
+ # Defines capifig:deploy which deploys configuration
2
+ require 'capistrano'
3
+ load File.expand_path("../tasks/capifig.rake", __FILE__)
@@ -0,0 +1,34 @@
1
+
2
+ namespace :capifig do
3
+ def remote_path(release_path, config_path, file)
4
+ path = Pathname.new(release_path) + relative_path(config_path, file)
5
+ path.to_s
6
+ end
7
+
8
+ # Given a local path, returns the relative path to the file
9
+ def relative_path(config_path, file)
10
+ path = Pathname.new(file).relative_path_from(Pathname.new(config_path)).to_s
11
+ # For security reasons, we check that the path does not contain any ..'s
12
+ raise ArgumentError, "File '#{file}' is not in '#{config_path}'" if path.include? '..'
13
+ path
14
+ end
15
+
16
+
17
+ desc <<-DESC
18
+ Deploy configuration files.
19
+ DESC
20
+ task :deploy do
21
+ on roles(:app) do
22
+ stage = fetch(:stage, 'production')
23
+ config_path = fetch(:config_path, "config/deploy/#{stage}")
24
+ files = `git ls-files #{config_path}`.split($/)
25
+ files.sort!
26
+ files.each do |f|
27
+ info "Uploading #{f}"
28
+ upload! f, remote_path(release_path, config_path, f)
29
+ end
30
+ end
31
+ end
32
+
33
+ before 'deploy:updated', 'capifig:deploy'
34
+ end
@@ -1,3 +1,3 @@
1
1
  module Capifig
2
- VERSION = "0.0.2"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -7,4 +7,7 @@ RSpec.configure do |config|
7
7
  config.before :each do
8
8
 
9
9
  end
10
+
11
+ # Use old syntax for now
12
+ config.expect_with(:rspec) { |c| c.syntax = :should }
10
13
  end
metadata CHANGED
@@ -1,30 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capifig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ralf Kistner
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-21 00:00:00.000000000 Z
11
+ date: 2015-06-17 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
21
19
  version: 2.0.0
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
29
26
  version: 2.0.0
30
27
  description: Deploy different configuration per stage with Capistrano (with the multi-stage
@@ -35,16 +32,19 @@ executables: []
35
32
  extensions: []
36
33
  extra_rdoc_files: []
37
34
  files:
38
- - .gitignore
39
- - .travis.yml
35
+ - ".gitignore"
36
+ - ".travis.yml"
40
37
  - Gemfile
38
+ - Gemfile.lock
41
39
  - LICENSE.txt
42
40
  - README.md
43
41
  - Rakefile
44
42
  - capifig.gemspec
45
43
  - lib/capifig.rb
46
44
  - lib/capifig/capistrano.rb
45
+ - lib/capifig/capistrano3.rb
47
46
  - lib/capifig/configuration.rb
47
+ - lib/capifig/tasks/capifig.rake
48
48
  - lib/capifig/version.rb
49
49
  - sample/.env
50
50
  - sample/Procfile
@@ -54,30 +54,28 @@ files:
54
54
  - spec/spec_helper.rb
55
55
  homepage: ''
56
56
  licenses: []
57
+ metadata: {}
57
58
  post_install_message:
58
59
  rdoc_options: []
59
60
  require_paths:
60
61
  - lib
61
62
  required_ruby_version: !ruby/object:Gem::Requirement
62
- none: false
63
63
  requirements:
64
- - - ! '>='
64
+ - - ">="
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  required_rubygems_version: !ruby/object:Gem::Requirement
68
- none: false
69
68
  requirements:
70
- - - ! '>='
69
+ - - ">="
71
70
  - !ruby/object:Gem::Version
72
71
  version: '0'
73
72
  requirements: []
74
73
  rubyforge_project:
75
- rubygems_version: 1.8.24
74
+ rubygems_version: 2.2.2
76
75
  signing_key:
77
- specification_version: 3
76
+ specification_version: 4
78
77
  summary: Deploy different configuration per stage with Capistrano.
79
78
  test_files:
80
79
  - spec/capistrano_spec.rb
81
80
  - spec/configuration_spec.rb
82
81
  - spec/spec_helper.rb
83
- has_rdoc: