pjam 0.0.1.pre
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.
- data/bin/pjam +77 -0
- data/lib/pjam.rb +4 -0
- metadata +110 -0
data/bin/pjam
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "rubygems";
|
4
|
+
require 'trollop'
|
5
|
+
require "json";
|
6
|
+
require 'term/ansicolor'
|
7
|
+
include Term::ANSIColor
|
8
|
+
|
9
|
+
opts = Trollop::options do
|
10
|
+
|
11
|
+
version "pjam 0.0.1 (c) 2013 Alexey Melezhik / melezhik@gmail.com"
|
12
|
+
banner <<-EOS
|
13
|
+
smart glue between pinto and your scm.
|
14
|
+
|
15
|
+
Usage:
|
16
|
+
pjam [options]
|
17
|
+
where [options] are:
|
18
|
+
EOS
|
19
|
+
|
20
|
+
opt :p, "path to project", :type => :string
|
21
|
+
opt :fast, "run is fast mode, skip some build steps", :default => false
|
22
|
+
end
|
23
|
+
|
24
|
+
project_id = "#{Dir.pwd}/#{opts[:p]}"
|
25
|
+
local_lib = "#{project_id}/cpanlib"
|
26
|
+
|
27
|
+
if (opts[:p].nil? || opts[:p].empty?)
|
28
|
+
Trollop::die :p, "must be set"
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
config = JSON.parse(File.read("#{project_id}/pjam.json"))
|
33
|
+
|
34
|
+
config['sources'].each do |src|
|
35
|
+
|
36
|
+
|
37
|
+
cmd = "cd #{project_id}/#{src} && rm -rf cpanlib && svn up"
|
38
|
+
st = system(cmd) == true or raise "failed do cmd: #{cmd}"
|
39
|
+
|
40
|
+
|
41
|
+
cmd = "eval $(perl -Mlocal::lib=#{local_lib}) && cd #{project_id}/#{src} && rm -rf *.gz && rm -rf MANIFEST && perl Build.PL --quiet 1>/dev/null && ./Build manifest --quiet 2>/dev/null 1>/dev/null && ./Build dist --quiet 1>/dev/null"
|
42
|
+
system(cmd) == true or raise "failed do cmd: #{cmd}"
|
43
|
+
|
44
|
+
cmd ="cd #{project_id}/#{src}/ && pinto list -s #{config['stack']} -D `ls *.gz` --format %f | grep `ls *.gz` -q"
|
45
|
+
distro_exists = system(cmd)
|
46
|
+
|
47
|
+
if distro_exists == false
|
48
|
+
puts dark { blue { bold { "add #{src} to pinto for the first time" } } }
|
49
|
+
cmd ="cd #{project_id}/#{src} && pinto add -s #{config['stack']} -v `ls *.gz`"
|
50
|
+
system(cmd) == true or raise "failed do cmd: #{cmd}"
|
51
|
+
elsif distro_exists == true && opts[:fast] == false
|
52
|
+
|
53
|
+
puts dark { magenta { bold { "delete #{src} from pinto" } } }
|
54
|
+
cmd ="cd #{project_id}/#{src}/ && pinto delete -v PINTO/`ls *.gz`"
|
55
|
+
system(cmd) == true or raise "failed do cmd: #{cmd}"
|
56
|
+
|
57
|
+
puts dark { blue { bold { "add #{src} to pinto" } } }
|
58
|
+
cmd ="cd #{project_id}/#{src} && pinto add -s #{config['stack']} -v `ls *.gz`"
|
59
|
+
system(cmd) == true or raise "failed do cmd: #{cmd}"
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
end
|
64
|
+
|
65
|
+
|
66
|
+
config['sources'].each do |src|
|
67
|
+
puts blue { bold { "compile #{src}" } }
|
68
|
+
cmd = "cd #{project_id}/#{src} && export PERL5LIB=/usr/local/rle/lib/perl5 && cpanm --mirror file://$PINTO_REPOSITORY_ROOT/stacks/#{config['stack']} --mirror-only -q -L #{local_lib} PINTO/`ls *.gz`"
|
69
|
+
system(cmd) == true or raise "failed do cmd: #{cmd}"
|
70
|
+
end
|
71
|
+
|
72
|
+
|
73
|
+
puts yellow { bold { "make distributive from #{config['application']}" } }
|
74
|
+
cmd = "eval $(perl -Mlocal::lib=#{local_lib}) && cd #{project_id}/#{config['application']} && rm -rf cpanlib && mkdir cpanlib/ && cp -r #{local_lib}/* cpanlib/ && rm -rf *.gz && ./Build realclean --quiet 1>/dev/null && perl Build.PL --quiet 1>/dev/null && ./Build manifest --quiet 2>/dev/null 1>/dev/null && ./Build dist --quiet 1>/dev/null && ln -fs `ls #{project_id}/#{config['application']}/*.gz` #{project_id}/current.tar.gz && echo -n `ls *.gz` > #{project_id}/current.txt"
|
75
|
+
system(cmd) == true or raise "failed do cmd: #{cmd}"
|
76
|
+
|
77
|
+
|
data/lib/pjam.rb
ADDED
metadata
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pjam
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 961915968
|
5
|
+
prerelease: 6
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
- pre
|
11
|
+
version: 0.0.1.pre
|
12
|
+
platform: ruby
|
13
|
+
authors:
|
14
|
+
- Alexey Melezhik
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2013-07-23 00:00:00 Z
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: json
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: term-ansicolor
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: trollop
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
type: :runtime
|
62
|
+
version_requirements: *id003
|
63
|
+
description: Smart pinto glue - jam between source code and pinto
|
64
|
+
email: melezhik@gmail.com
|
65
|
+
executables:
|
66
|
+
- pjam
|
67
|
+
extensions: []
|
68
|
+
|
69
|
+
extra_rdoc_files: []
|
70
|
+
|
71
|
+
files:
|
72
|
+
- lib/pjam.rb
|
73
|
+
- bin/pjam
|
74
|
+
homepage: https://github.com/melezhik/jam
|
75
|
+
licenses:
|
76
|
+
- MIT
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
|
80
|
+
require_paths:
|
81
|
+
- lib
|
82
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
hash: 3
|
88
|
+
segments:
|
89
|
+
- 0
|
90
|
+
version: "0"
|
91
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
|
+
none: false
|
93
|
+
requirements:
|
94
|
+
- - ">"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
hash: 25
|
97
|
+
segments:
|
98
|
+
- 1
|
99
|
+
- 3
|
100
|
+
- 1
|
101
|
+
version: 1.3.1
|
102
|
+
requirements: []
|
103
|
+
|
104
|
+
rubyforge_project:
|
105
|
+
rubygems_version: 1.8.15
|
106
|
+
signing_key:
|
107
|
+
specification_version: 3
|
108
|
+
summary: smart pinto glue
|
109
|
+
test_files: []
|
110
|
+
|