buildable 2.2.0 → 2.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a0e645a17e9a96827384ac30a56b6c241f34279
4
- data.tar.gz: 982b1988da7fd81cd03d8c9e0f208edcfcf2aa9f
3
+ metadata.gz: 4f2bd089d0ff417e7516948c378f34ecab4fb7fa
4
+ data.tar.gz: 272c50fbf47584957018561b13307b6b76d26727
5
5
  SHA512:
6
- metadata.gz: 4d7a311b1b57f07a4139e29292f4be258c9e7996149a1f4134537d2ef36552659871837fe1dc139750a2b0436d4837e9f6fa634e0ea939f6b9e6ce75463cbcdb
7
- data.tar.gz: 04d193f18d0c58a2d796cd844f454f4b9cc37839d1a57bbc01d180319ecf7d84bc2112038793f90e429ae763dcf9ea4c597333cba6bf8e4583d32ee137de605c
6
+ metadata.gz: a1044c1158517929cb27e74434adfd3b08e82501cd348ad789953c48f03e7903a2a8b6ff19f6e6cf166d53423fe3987fb8dccd1ed7db6854993152fe3f2fcdb4
7
+ data.tar.gz: 0b39d0cac6eaf7ea0ed1c09a781d3bf827233cdc5eddf5368776ee2dac2d5a055010c02d6816c77da3b1c5f4373f5b46676c2081f08e8f2838304360e08015bb
data/README.md CHANGED
@@ -45,6 +45,12 @@ Para gerar o pacote basta executar o seguinte comando:
45
45
  $ buildable build
46
46
  ```
47
47
 
48
+ Quando o projeto não for um serviço, é possível desabilitar a criação do script de inicialização executando:
49
+
50
+ ```shell
51
+ $ buildable build --no-init
52
+ ```
53
+
48
54
  ### Via rake
49
55
 
50
56
  Para utilizar o _Buildable_ com o rake é necessário inluir o require no Rakefile
@@ -67,6 +73,12 @@ Para gerar o pacote basta executar
67
73
  $ bundle exec rake buildable:build
68
74
  ```
69
75
 
76
+ e para gerar o pacote sem script de inicialização
77
+
78
+ ```shell
79
+ $ bundle exec rake buildable:build -- --no-init
80
+ ```
81
+
70
82
  _Para uma lista completa das tasks execute rake -D_
71
83
 
72
84
 
@@ -1,7 +1,7 @@
1
1
  #!/bin/env ruby
2
2
  require 'buildable'
3
3
 
4
- case ARGV.join(' ')
4
+ case ARGV.first
5
5
  when 'init'
6
6
  Buildable.init
7
7
  when 'build'
@@ -1,11 +1,11 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'buildable/version'
4
+ VERSION = `git describe --abbrev=0`
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "buildable"
8
- spec.version = Buildable::VERSION
8
+ spec.version = `git describe --abbrev=0`
9
9
  spec.authors = ["Alexandre Prates"]
10
10
  spec.email = ["ajfprates@gmail.com"]
11
11
  spec.summary = %q{Gem para criação de pacotes deb}
@@ -6,7 +6,6 @@ module Buildable
6
6
  require_relative 'buildable/shell'
7
7
  require_relative 'buildable/file_maker'
8
8
  require_relative 'buildable/recipe'
9
- require_relative 'buildable/version'
10
9
 
11
10
  include ::Configureasy
12
11
  load_config '.buildable', as: 'config', path: '.'
@@ -27,7 +26,7 @@ module Buildable
27
26
  Recipe[:create_path]
28
27
  Recipe[:copy_source]
29
28
  Recipe[:vendor_gems]
30
- Recipe[:make_init_script]
29
+ Recipe[:make_init_script] unless ARGV.include?('--no-init')
31
30
  Recipe[:make_package]
32
31
  Recipe[:remove_path]
33
32
  end
@@ -61,7 +60,12 @@ module Buildable
61
60
 
62
61
  # Make package name using Organization name (when available) with project name
63
62
  def package_name
64
- [config.organization, config.project_name].compact.collect(&:underscore).join('-')
63
+ [self.config.organization, self.config.project_name].compact.collect(&:underscore).join('-')
64
+ end
65
+
66
+ # Return array with all dependencies specified in .buildable.yml
67
+ def dependencies
68
+ self.config.depends || []
65
69
  end
66
70
 
67
71
  end
@@ -60,19 +60,18 @@ module Buildable::Recipe
60
60
  '--prefix': '/',
61
61
  '--description': Buildable.config.description.inspect,
62
62
  '--force': nil,
63
- }
63
+ }.compare_by_identity
64
64
 
65
65
  params['--deb-user'] = Buildable.config.app_user if Buildable.config.app_user
66
66
  params['--deb-group'] = Buildable.config.app_group if Buildable.config.app_group
67
67
 
68
- if Buildable.config.respond_to? :depends
69
- params.compare_by_identity
70
- Buildable.config.depends.each do |package|
71
- params['--depends'] = package
72
- end
68
+ Buildable.dependencies.each do |package|
69
+ key = '--depends'.clone # force generate new object
70
+ params[key] = package
73
71
  end
74
72
 
75
73
  params['-C'] = "#{Buildable::BUILD_ROOT_DIR} ." # must be last parameter
74
+
76
75
  result = Buildable::Shell.do_quiet 'fpm', params
77
76
  raise "Can't create package, error:\n#{result}" unless Buildable::Shell.success?
78
77
  package_name = result.match(/:path=>"\.\/pkg\/([^"]*)/)[1]
@@ -15,9 +15,11 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin
15
15
  NAME=<%= app %>
16
16
  USERNAME=<%= user %>
17
17
  <% engine.each_process do |name, process| -%>
18
- <%= name %>_pidfile=/var/run/<%= app %>_<%= name %>.pid
18
+ <%= name %>_pidfile=/var/run/<%= app %>/<%= name %>.pid
19
19
  <% end -%>
20
20
 
21
+ mkdir -p /var/run/<%= app %>
22
+
21
23
  [ -r /lib/lsb/init-functions ] &&. /lib/lsb/init-functions
22
24
 
23
25
  #
@@ -69,10 +71,10 @@ show_status()
69
71
  <% engine.each_process do |name, process| -%>
70
72
  start_<%= name %>()
71
73
  {
72
- su - $USERNAME <<EOS | cut -d ' ' -f 2 > $<%= name %>_pidfile
74
+ su - $USERNAME <<EOS > $<%= name %>_pidfile
73
75
  cd <%= engine.root %>
74
76
  <%= engine.environment.collect { |k,v| "#{k}=#{v} " }.join %><%= process.command %> > /dev/null 2>&1 &
75
- jobs -l
77
+ echo \$!
76
78
  EOS
77
79
  log_end_msg $?
78
80
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Prates
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-25 00:00:00.000000000 Z
11
+ date: 2017-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -106,7 +106,6 @@ files:
106
106
  - lib/buildable/recipes/build.rb
107
107
  - lib/buildable/recipes/init.rb
108
108
  - lib/buildable/shell.rb
109
- - lib/buildable/version.rb
110
109
  - lib/core_ext/hash.rb
111
110
  - lib/core_ext/string.rb
112
111
  - templates/.buildable.yml.erb
@@ -135,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
134
  version: '0'
136
135
  requirements: []
137
136
  rubyforge_project:
138
- rubygems_version: 2.5.1
137
+ rubygems_version: 2.4.5
139
138
  signing_key:
140
139
  specification_version: 4
141
140
  summary: Gem para criação de pacotes deb
@@ -1,3 +0,0 @@
1
- module Buildable
2
- VERSION = "2.2.0"
3
- end