capistrano-config-files-deploy 0.1.1

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: 3915cca006460d0e5fd84a016a8a1327575dce02
4
+ data.tar.gz: 2abcc2c31175d328399e9b841b775a3695f6c409
5
+ SHA512:
6
+ metadata.gz: 8ea7eaf19f4f0b3b5ccd69d64d938f4bb7e68ff955770a6c4e50b056e37663afcfe9190df1f856889b2c608ebc46b9037d3747f78b6b1cd667ec76bd263fc261
7
+ data.tar.gz: 076786f3ba1c359deb90f2ce7bed1984c0034ff872799741faa7a7e009788c12dada13edb445c069489436915cdf090d8ac19b3ce79a3512360be61e54c6841d
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-config_files_deploy.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Capistrano::ConfigFilesDeploy
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/capistrano/config_files_deploy`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'capistrano-config-files-deploy'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install capistrano-config-files-deploy
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/J.Fukaya/capistrano-config_files_deploy.
36
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "capistrano/config_files_deploy"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/config_files_deploy/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano-config-files-deploy"
8
+ spec.version = Capistrano::ConfigFilesDeploy::VERSION
9
+ spec.authors = ["fukajun"]
10
+ spec.email = ["fukajun.shark@gmail.com"]
11
+
12
+ spec.summary = %q{Deploy config files via Capistrano.}
13
+ spec.description = %q{Deploy config files via Capistrano.}
14
+ spec.homepage = "https://github.com/fukajun/capistrano-config-files-deploy"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
17
+ f.match(%r{^(test|spec|features)/})
18
+ end
19
+ spec.bindir = "exe"
20
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
+ spec.require_paths = ["lib"]
22
+
23
+ spec.add_dependency "capistrano", "~> 3.1"
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.14"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ end
@@ -0,0 +1,3 @@
1
+ require "capistrano/config_files_deploy/version"
2
+ require "capistrano/config_files_deploy/helpers"
3
+ load File.expand_path("../tasks/config_files_deploy.rake", __FILE__)
@@ -0,0 +1,13 @@
1
+ module Capistrano
2
+ module ConfigFilesDeploy
3
+ module Helpers
4
+ def config_repo_path
5
+ deploy_to = fetch(:deploy_to)
6
+ if(deploy_to.nil?)
7
+ warn 'config_files_deploy: deploy_to is not set'
8
+ end
9
+ "#{deploy_to}/config_repo"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module ConfigFilesDeploy
3
+ VERSION = "0.1.1"
4
+ end
5
+ end
@@ -0,0 +1,53 @@
1
+ # set :config_files # { '.env.production' => '.env.production', 'config/settings.yml.production' => 'config/setttings.yml' }
2
+ # set :config_files_git_url # ENV['CONFIG_GIT_URL"] OR "git://github.com/foo/bar"
3
+ # set :config_files_git_rivision # 'master'
4
+ # set :config_files_roles # :all
5
+ include Capistrano::ConfigFilesDeploy::Helpers
6
+
7
+ set_if_empty :config_files, {}
8
+ set_if_empty :config_files_git_revision, 'master'
9
+ set_if_empty :config_files_roles, :all
10
+
11
+ namespace :config_files do
12
+ desc 'Download config files from remote git repository'
13
+ task :download do
14
+ on roles(fetch(:config_files_roles)) do |host|
15
+ if test "[ -e #{config_repo_path} ]"
16
+ execute 'rm', '-rf', config_repo_path
17
+ end
18
+ execute 'git', 'clone', fetch(:config_files_git_url), config_repo_path
19
+ end
20
+ end
21
+
22
+ task :checkout_revision do
23
+ on roles(fetch(:config_files_roles)) do |host|
24
+ fetch(:config_files).each do |source_path, dest_path|
25
+ execute 'git', '-C', config_repo_path, 'checkout', fetch(:config_files_git_revision)
26
+ end
27
+ end
28
+ end
29
+
30
+ task :copy_files do
31
+ on roles(fetch(:config_files_roles)) do |host|
32
+ fetch(:config_files).each do |source_path, dest_path|
33
+ execute 'cp', '-f', "#{config_repo_path}/#{source_path}", "#{release_path}/#{dest_path}"
34
+ end
35
+ end
36
+ end
37
+
38
+ task :remove_tmp_files do
39
+ on roles(fetch(:config_files_roles)) do |host|
40
+ execute 'rm', '-rf', config_repo_path
41
+ end
42
+ end
43
+
44
+ desc 'Install each config files'
45
+ task :install do
46
+ invoke 'config_files:download'
47
+ invoke 'config_files:checkout_revision'
48
+ invoke 'config_files:copy_files'
49
+ invoke 'config_files:remove_tmp_files'
50
+ end
51
+
52
+ before 'deploy:publishing', 'config_files:install'
53
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-config-files-deploy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - fukajun
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-02-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.14'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.14'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '10.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '10.0'
55
+ description: Deploy config files via Capistrano.
56
+ email:
57
+ - fukajun.shark@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - README.md
65
+ - Rakefile
66
+ - bin/console
67
+ - bin/setup
68
+ - capistrano-config-files-deploy.gemspec
69
+ - lib/capistrano/config_files_deploy.rb
70
+ - lib/capistrano/config_files_deploy/helpers.rb
71
+ - lib/capistrano/config_files_deploy/version.rb
72
+ - lib/capistrano/tasks/config_files_deploy.rake
73
+ homepage: https://github.com/fukajun/capistrano-config-files-deploy
74
+ licenses: []
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.5.1
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Deploy config files via Capistrano.
96
+ test_files: []