gradle-to-capistrano 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 742cab5e054149280ae2b1ba520801b29c6848eb
4
+ data.tar.gz: 9ea98879c9f0e029e3896fc3190ae95962802be1
5
+ SHA512:
6
+ metadata.gz: 9a5546d7b06cf067c2815de06bf83f8881b27488a6958947e43a3a21f3c36ce5f80107e28a282ca82da9209ee56e6d6cd3391554135e0c4fd74a47f2e56e40c2
7
+ data.tar.gz: 08afd15c2c34dee733179cd54b86f8c10171b1040ca4e3fc108d1999ae3a03736856f324ced54e9678cde160d3e04c33777b92ff3de66c2c86b36b0993c6f775
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "bundler", "~> 1.0"
10
+ gem "jeweler", "~> 1.8.7"
11
+ end
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Marcos Sousa
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,32 @@
1
+ = gradle-to-capistrano gem
2
+
3
+ This project is used to integrate gradle projects with capistrano deploy scripts.
4
+
5
+ First install the gem:
6
+ `gem install gradle-to-capistrano`
7
+
8
+ Configure your gradle file with:
9
+
10
+ project(':my-fucking-owesome-project') {
11
+ apply plugin:'application'
12
+
13
+ distTar {
14
+ archiveName = "$tarName"
15
+ }
16
+ }
17
+
18
+ And just set `:deploy_via` to `gradle_build`:
19
+
20
+ set :deploy_via, :gradle_build
21
+ set :gradle_cmd, ":my-fucking-owesome-project:distTar -PtarName={release_name}"
22
+ set :gradle_home, "/opt/gradle-1.8/bin"
23
+
24
+ Cool! Now you can deploy you gradle application.
25
+
26
+ Comments and suggestions are appreciated :)
27
+
28
+ == Copyright
29
+
30
+ Copyright (c) 2013 Marcos Sousa. See LICENSE.txt for
31
+ further details.
32
+
data/Rakefile ADDED
@@ -0,0 +1,35 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "gradle-to-capistrano"
18
+ gem.homepage = "http://github.com/marcossousa/gradle-to-capistrano"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Capistrano recipe to run gradle commands to generate deployable artifacts}
21
+ gem.description = %Q{This extension should be used to run gradle commands on gradle based projects. The artifacts generated will be compreessed and copied to the server}
22
+ gem.email = "falecomigo@marcossousa.com"
23
+ gem.authors = ["Marcos Sousa"]
24
+ end
25
+ Jeweler::RubygemsDotOrgTasks.new
26
+
27
+ require 'rdoc/task'
28
+ Rake::RDocTask.new do |rdoc|
29
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
30
+
31
+ rdoc.rdoc_dir = 'rdoc'
32
+ rdoc.title = "gradle-to-capistrano #{version}"
33
+ rdoc.rdoc_files.include('README*')
34
+ rdoc.rdoc_files.include('lib/**/*.rb')
35
+ end
@@ -0,0 +1,30 @@
1
+ require 'capistrano/recipes/deploy/strategy/copy'
2
+
3
+ module Capistrano
4
+ module Deploy
5
+ module Strategy
6
+ class GradleBuild < Copy
7
+ def deploy!
8
+ execute "Running gradle build command" do
9
+ run_locally "#{gradle_home}/gradle #{gradle_cmd.gsub!('{release_name}', "#{File.basename(destination)}.tar")}"
10
+ run_locally "mv build/distributions/#{File.basename(destination)}.tar /tmp/"
11
+ end
12
+
13
+ execute "Decompressing gradle build to put REVISON file" do
14
+ run_locally "cd /tmp/ && tar -xf /tmp/#{File.basename(destination)}.tar"
15
+ end
16
+ create_revision_file
17
+ compress_repository
18
+ distribute!
19
+ ensure
20
+ rollback_changes
21
+ end
22
+
23
+ def rollback_changes
24
+ run_locally "rm -rf build/distributions/*"
25
+ run_locally "rm -rf /tmp/#{File.basename(destination)}*"
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1 @@
1
+ require 'capistrano/recipes/deploy/strategy/gradle_build'
data/test/helper.rb ADDED
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'test/unit'
11
+ require 'shoulda'
12
+
13
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
15
+ require 'gradle-to-capistrano'
16
+
17
+ class Test::Unit::TestCase
18
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestGradleToCapistrano < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gradle-to-capistrano
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Marcos Sousa
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-09-27 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.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: jeweler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.8.7
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: 1.8.7
41
+ description: This extension should be used to run gradle commands on gradle based
42
+ projects. The artifacts generated will be compreessed and copied to the server
43
+ email: falecomigo@marcossousa.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files:
47
+ - LICENSE.txt
48
+ - README.rdoc
49
+ files:
50
+ - .document
51
+ - Gemfile
52
+ - LICENSE.txt
53
+ - README.rdoc
54
+ - Rakefile
55
+ - lib/capistrano/recipes/deploy/strategy/gradle_build.rb
56
+ - lib/gradle-to-capistrano.rb
57
+ - test/helper.rb
58
+ - test/test_gradle-to-capistrano.rb
59
+ homepage: http://github.com/marcossousa/gradle-to-capistrano
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.0.6
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: Capistrano recipe to run gradle commands to generate deployable artifacts
83
+ test_files: []