pjam 0.0.11.pre → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/pjam +54 -36
  2. data/lib/pjam-server.rb +32 -0
  3. metadata +5 -36
data/bin/pjam CHANGED
@@ -22,8 +22,17 @@ EOS
22
22
  opt :no_color, "do not colour output", :default => false
23
23
  opt :no_misc, "do not add miscellaneous prerequisites", :default => false
24
24
  opt :only, "only add given source(s). multiple sources are separated by comma", :type => :string, :default => nil
25
+ opt :only_pinto, "only do pinto phase, skip distribution phase", :default => false
25
26
  end
26
27
 
28
+ version_postfix = `date +-rev-%Y-%B-%d-%H-%M`.chomp!
29
+
30
+
31
+ if opts[:no_color] == true
32
+ puts "generated version postfix: #{version_postfix}"
33
+ else
34
+ puts dark { yellow { bold { "generated version postfix: #{version_postfix}" } } }
35
+ end
27
36
 
28
37
  project_id = "#{Dir.pwd}/#{opts[:p]}"
29
38
  local_lib = "#{project_id}/cpanlib"
@@ -43,7 +52,7 @@ config = JSON.parse(File.read("#{project_id}/pjam.json"))
43
52
 
44
53
  misc_modules = []
45
54
 
46
- if config.has_key? 'modules' and opts[:no_misc] == false
55
+ if config.has_key? 'modules' and opts[:no_misc] == false and opts[:skip_pinto] == false
47
56
 
48
57
  if opts[:no_color] == true
49
58
  puts "pulling / compiling misc modules"
@@ -58,7 +67,7 @@ if config.has_key? 'modules' and opts[:no_misc] == false
58
67
  else
59
68
  puts dark { magenta { bold { "pull #{m}" } } }
60
69
  end
61
- cmd ="pinto pull -s #{config['stack']} -v #{m} #{color_flag}"
70
+ cmd ="pinto pull -s #{config['stack']} -v --use-default-message #{m} #{color_flag}"
62
71
  system(cmd) == true or raise "failed do cmd: #{cmd}"
63
72
 
64
73
  misc_modules << m
@@ -67,10 +76,12 @@ if config.has_key? 'modules' and opts[:no_misc] == false
67
76
  end
68
77
 
69
78
  sources_list = []
79
+ only_list = []
70
80
  if opts[:only].nil?
71
81
  sources_list = config['sources']
72
82
  else
73
83
  p_only = opts[:only].split(/\s+/)
84
+ only_list = p_only
74
85
  sources_list = config['sources'].select {|i| p_only.include? i }
75
86
  end
76
87
 
@@ -82,7 +93,7 @@ sources_list.each do |src|
82
93
  cmd = "cd #{project_id}/#{src} && rm -rf cpanlib && svn up "
83
94
  st = system(cmd) == true or raise "failed do cmd: #{cmd}"
84
95
 
85
- cmd = "cd #{project_id}/#{src} && rm -rf *.gz && rm -rf MANIFEST && perl Build.PL --quiet 1>/dev/null 2>module_build.err.log && ./Build realclean && perl Build.PL --quiet 1>/dev/null 2>module_build.err.log && ./Build manifest --quiet 2>/dev/null 1>/dev/null && ./Build dist --quiet 1>/dev/null"
96
+ cmd = "export version_postfix='#{version_postfix}' && cd #{project_id}/#{src} && rm -rf *.gz && rm -rf MANIFEST && perl Build.PL --quiet 1>/dev/null 2>module_build.err.log && ./Build realclean && perl Build.PL --quiet 1>/dev/null 2>module_build.err.log && ./Build manifest --quiet 2>/dev/null 1>/dev/null && ./Build dist --quiet 1>/dev/null"
86
97
  system(cmd) == true or raise "failed do cmd: #{cmd}"
87
98
 
88
99
  distro_name = `cd #{project_id}/#{src} && ls *.gz`.chomp!
@@ -104,7 +115,7 @@ sources_list.each do |src|
104
115
  cmd ="cd #{project_id}/#{src} && pinto delete -v PINTO/#{distro_name} #{color_flag}"
105
116
  system(cmd) == true
106
117
 
107
- cmd ="cd #{project_id}/#{src} && pinto add -s #{config['stack']} -v #{distro_name} #{color_flag}"
118
+ cmd ="cd #{project_id}/#{src} && pinto add -s #{config['stack']} -v --use-default-message #{distro_name} #{color_flag}"
108
119
  system(cmd) == true or raise "failed do cmd: #{cmd}"
109
120
 
110
121
  compile_list << distro_name
@@ -114,49 +125,56 @@ sources_list.each do |src|
114
125
 
115
126
  end
116
127
 
128
+ unless opts[:only_pinto] == true
117
129
 
118
- misc_modules.each do |m|
130
+ misc_modules.each do |m|
119
131
 
120
- if opts[:no_color] == true
121
- puts "compile #{m}"
122
- else
123
- puts green { bold { "compile #{m}" } }
124
- end
132
+ if opts[:no_color] == true
133
+ puts "compile #{m}"
134
+ else
135
+ puts green { bold { "compile #{m}" } }
136
+ end
125
137
 
126
- cmd = "pinto install -s #{config['stack']} -l #{local_lib} -o 'q' #{m} #{color_flag}"
127
- system(cmd) == true or raise "failed do cmd: #{cmd}"
128
- end
138
+ cmd = "pinto install -s #{config['stack']} -l #{local_lib} -o 'v' #{m} #{color_flag}"
139
+ system(cmd) == true or raise "failed do cmd: #{cmd}"
140
+ end
129
141
 
130
142
 
131
- compile_list.each do |d|
143
+ compile_list.each do |d|
132
144
 
133
- if opts[:no_color] == true
134
- puts "compile #{compile_list_pp[d]} [#{d}]"
135
- else
136
- puts green { bold { "compile #{compile_list_pp[d]} [#{d}]" } }
137
- end
145
+ if opts[:no_color] == true
146
+ puts "compile #{compile_list_pp[d]} [#{d}]"
147
+ else
148
+ puts green { bold { "compile #{compile_list_pp[d]} [#{d}]" } }
149
+ end
138
150
 
139
- cmd = "pinto install -s #{config['stack']} -l #{local_lib} -o 'q' PINTO/#{d} #{color_flag}"
140
- system(cmd) == true or raise "failed do cmd: #{cmd}"
141
- end
151
+ cmd = "pinto install -s #{config['stack']} -l #{local_lib} -o 'q' PINTO/#{d} #{color_flag}"
152
+ system(cmd) == true or raise "failed do cmd: #{cmd}"
142
153
 
154
+ end
143
155
 
144
- if opts[:no_color] == true
145
- puts "make distributive from #{config['application']}"
146
- else
147
- puts yellow { bold { "make distributive from #{config['application']}" } }
148
- end
156
+ if only_list.empty? or only_list.include? config['application']
149
157
 
150
- cmd = "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 2>module_build.err.log && ./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"
151
- system(cmd) == true or raise "failed do cmd: #{cmd}"
158
+ if opts[:no_color] == true
159
+ puts "make distributive from #{config['application']}"
160
+ else
161
+ puts yellow { bold { "make distributive from #{config['application']}" } }
162
+ end
152
163
 
164
+ cmd = "export version_postfix='#{version_postfix}' && 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 2>module_build.err.log && ./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"
165
+ puts cmd
166
+ system(cmd) == true or raise "failed do cmd: #{cmd}"
153
167
 
154
- if opts[:no_color] == true
155
- puts "testing #{config['application']}"
156
- else
157
- puts cyan { bold { "testing #{config['application']}" } }
158
- end
159
168
 
160
- cmd = "cd #{project_id} && pinto install -s #{config['stack']} -l #{local_lib} -o 'test-only' PINTO/`cat current.txt` #{color_flag}"
161
- system(cmd) == true or raise "failed do cmd: #{cmd}"
169
+ if opts[:no_color] == true
170
+ puts "testing #{config['application']}"
171
+ else
172
+ puts cyan { bold { "testing #{config['application']}" } }
173
+ end
174
+
175
+ cmd = "cd #{project_id} && pinto install -s #{config['stack']} -l #{local_lib} -o 'test-only' PINTO/`cat current.txt` #{color_flag}"
176
+ system(cmd) == true or raise "failed do cmd: #{cmd}"
162
177
 
178
+ end
179
+
180
+ end
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+
3
+
4
+ require 'sinatra'
5
+
6
+ get %r{/build/(.*)} do |req|
7
+
8
+ content_type :text
9
+ args = req.split '/'
10
+ project = args.shift
11
+ flags = ''
12
+ unless args.empty?
13
+ args.each do |a|
14
+ flags << "--#{a} "
15
+ end
16
+ end
17
+ command = "pjam -p #{project} #{flags} 1>pjam-server.log 2>&1"
18
+ st = system(command)
19
+ if st == true
20
+ body File.read("pjam-server.log")
21
+ else
22
+ body File.read("pjam-server.log")
23
+ status 500
24
+ end
25
+
26
+ end
27
+
28
+ get '/' do
29
+ content_type :text
30
+ `ls -1 2>&1`
31
+ end
32
+
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pjam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11.pre
5
- prerelease: 7
4
+ version: 0.1.0
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Alexey Melezhik
@@ -75,38 +75,6 @@ dependencies:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
- - !ruby/object:Gem::Dependency
79
- name: sinatra-contrib
80
- requirement: !ruby/object:Gem::Requirement
81
- none: false
82
- requirements:
83
- - - ! '>='
84
- - !ruby/object:Gem::Version
85
- version: '0'
86
- type: :runtime
87
- prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
94
- - !ruby/object:Gem::Dependency
95
- name: thin
96
- requirement: !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ! '>='
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- type: :runtime
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
110
78
  description: Pjam is glue between pinto and your scm. In other words pjam is a wrapper
111
79
  around pinto client to create distribution archive of perl applications from source
112
80
  code using pinto.
@@ -117,6 +85,7 @@ extensions: []
117
85
  extra_rdoc_files: []
118
86
  files:
119
87
  - lib/pjam.rb
88
+ - lib/pjam-server.rb
120
89
  - bin/pjam
121
90
  homepage: https://github.com/melezhik/jam
122
91
  licenses:
@@ -134,9 +103,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
134
103
  required_rubygems_version: !ruby/object:Gem::Requirement
135
104
  none: false
136
105
  requirements:
137
- - - ! '>'
106
+ - - ! '>='
138
107
  - !ruby/object:Gem::Version
139
- version: 1.3.1
108
+ version: '0'
140
109
  requirements: []
141
110
  rubyforge_project:
142
111
  rubygems_version: 1.8.25