capistrano-middleman 0.0.1

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: 1191fecc0afe53ccb5d246a73dc13c3ab7e0b68f
4
+ data.tar.gz: 7dd7e2daf663dfe122f92ad4b1e4855bc981f0c8
5
+ SHA512:
6
+ metadata.gz: 981a7c5b9f3ac93c6f40a4675583649ef6360f3f1e8fd2785032ff829041126801714f3300461e598a2793372088863194ca9b5bf30559e6c0d876a6c6ef7570
7
+ data.tar.gz: 7d4b29b21a82688a891593df61d1216bb08edfd649b92c97d22154dc360c72cf1ce56f68f7a49d252ef7ddd95695af478e35a8fba6487de05e6989eb3eaa0ced
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano-middleman.gemspec
4
+ gemspec
5
+
6
+ gem 'rake', '~>10.0'
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Max Meyer
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.
@@ -0,0 +1,31 @@
1
+ # Capistrano::Middleman
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'capistrano-middleman'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install capistrano-middleman
20
+
21
+ ## Usage
22
+
23
+ TODO: Write usage instructions here
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/capistrano-middleman/fork )
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 a new Pull Request
@@ -0,0 +1,2 @@
1
+ require 'bundler/gem_tasks'
2
+
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano/middleman/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'capistrano-middleman'
8
+ spec.version = Capistrano::Middleman::VERSION
9
+ spec.authors = ['Max Meyer']
10
+ spec.email = ['dev@fedux.org']
11
+ spec.summary = %q{Middleman deploy strategy for capistrano}
12
+ spec.homepage = 'https://github.com/maxmeyer/capistrano-middleman'
13
+ spec.license = 'MIT'
14
+
15
+ spec.files = `git ls-files -z`.split("\x0")
16
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ['lib']
19
+
20
+ spec.add_development_dependency 'bundler', '~> 1.7'
21
+
22
+ spec.add_runtime_dependency 'middleman', '~> 3.3'
23
+ spec.add_runtime_dependency 'capistrano', '~> 3'
24
+ end
@@ -0,0 +1 @@
1
+ require 'capistrano/middleman/version'
@@ -0,0 +1 @@
1
+ load File.expand_path('../tasks/middleman.rake', __FILE__)
@@ -0,0 +1,5 @@
1
+ module Capistrano
2
+ module Middleman
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,60 @@
1
+ namespace :middleman do
2
+ middleman_options = Array(fetch(:middleman_options, %w(--verbose)))
3
+
4
+ archive_name = fetch :archive_name, 'archive.tar.gz'
5
+ build_dir = fetch :build_dir, 'build'
6
+ source_dir = fetch :source_dir, 'source'
7
+ exclude_dir = Array(fetch(:exclude_dir))
8
+ exclude_args = exclude_dir.map { |dir| "--exclude '#{dir}'"}
9
+
10
+ tar_roles = fetch(:tar_roles, :all)
11
+
12
+ desc "Archive files to #{archive_name}"
13
+ file archive_name => source_dir do |t|
14
+ cmd = %w(middleman build)
15
+ cmd.concat middleman_options
16
+
17
+ sh cmd.join(' ')
18
+
19
+ files = FileList.new(File.join(build_dir, '*')).sub(%r{#{build_dir}/?}, '')
20
+
21
+ cmd = %w(tar -cvzf)
22
+ cmd << t.name
23
+ cmd << "-C #{build_dir}"
24
+ cmd.concat exclude_args
25
+ cmd.concat files
26
+
27
+ sh cmd.join(' ')
28
+ end
29
+
30
+ desc "Deploy #{archive_name} to release_path"
31
+ task create_release: archive_name do |t|
32
+ tarball = t.prerequisites.first
33
+
34
+ on release_roles tar_roles do |host|
35
+ # Make sure the release directory exists
36
+ puts "==> release_path: #{release_path} is created on #{tar_roles} roles <=="
37
+ execute :install, "-d -m 755", release_path
38
+
39
+ # Create a temporary file on the server
40
+ tmp_file = capture('mktemp')
41
+
42
+ # Upload the archive, extract it and finally remove the tmp_file
43
+ upload!(tarball, tmp_file)
44
+
45
+ execute :tar, '-xzf', tmp_file, '-C', release_path
46
+ execute :rm, '-f', tmp_file
47
+ end
48
+ end
49
+
50
+ desc 'Cleaning up deploy'
51
+ task :clean do |t|
52
+ FileUtils.rm_rf build_dir
53
+ FileUtils.rm_rf archive_name
54
+ end
55
+
56
+ after 'deploy:finished', 'middleman:clean'
57
+
58
+ task :check
59
+ task :set_current_revision
60
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-middleman
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Max Meyer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: middleman
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: capistrano
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3'
55
+ description:
56
+ email:
57
+ - dev@fedux.org
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - capistrano-middleman.gemspec
68
+ - lib/capistrano-middleman.rb
69
+ - lib/capistrano/middleman.rb
70
+ - lib/capistrano/middleman/version.rb
71
+ - lib/capistrano/tasks/middleman.rake
72
+ homepage: https://github.com/maxmeyer/capistrano-middleman
73
+ licenses:
74
+ - MIT
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.4.5
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Middleman deploy strategy for capistrano
96
+ test_files: []
97
+ has_rdoc: