pkgr 1.4.1 → 1.4.2

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: c4957e699c5faccb2beb397df7d38bbdc4bf0fb9
4
- data.tar.gz: 8519e2b2f524e20c44a4df5353551c56f37f8e3f
3
+ metadata.gz: 8286cde02aee6871c83a01b3e4bde67d7e2c064d
4
+ data.tar.gz: 7e835d88af2324a41ec228e5493acf6f4e1b52cf
5
5
  SHA512:
6
- metadata.gz: 11d14b4e33696c5a7dbcafe08f65847a4524f153022829f5b29c37b21f2f8739fda1659b80fd4f0b51050be8a75e4c1028d004ac92304d7f0dbffcf3b80b1fc7
7
- data.tar.gz: 99bb15a764f2716e7cddac6e5cd9ce852ff070c8b5237df322e762118110ce5ddf550c09b06057d361682483ff7992226fc2814753c98c9c67f5f0a8e71e23af
6
+ metadata.gz: 7a275a87b5c5b14ffbf62d0740dfae27474b4dab84ed184c06a456170a8b5758b22fa7f0329f847f06901d3e521c1f46a3c9430512f07af09db84acdc0d58d2d
7
+ data.tar.gz: 20d5a23367770c6aab4a61f0d73fb4829c98d1f55258d59647642777e60e165c3dda87730e00d3f8b3d7b4ba5afe75d5fdeec81b239a11b4647f352761209bd4
@@ -183,7 +183,7 @@ scale_down() {
183
183
  PROCESS_ID="${APP_NAME}-${PROCESS_NAME}-${index}"
184
184
 
185
185
  if [ "${APP_RUNNER_TYPE}" = "upstart" ]; then
186
- $APP_RUNNER_CLI stop "${PROCESS_ID}"
186
+ $APP_RUNNER_CLI stop "${PROCESS_ID}" || /bin/true # dont fail if server stopped differently
187
187
  rm -f $(_p "/etc/init/${PROCESS_ID}.conf")
188
188
  else
189
189
  $(_p "/etc/init.d/${PROCESS_ID}") stop
@@ -36,7 +36,6 @@ module Pkgr
36
36
  write_init
37
37
  setup_crons
38
38
  package
39
- verify
40
39
  store_cache
41
40
  ensure
42
41
  teardown if config.clean
@@ -188,11 +187,20 @@ module Pkgr
188
187
 
189
188
 
190
189
  # Launch the FPM command that will generate the package.
191
- def package
190
+ def package(remaining_attempts = 3)
192
191
  app_package = Mixlib::ShellOut.new(fpm_command)
193
192
  app_package.logger = Pkgr.logger
194
193
  app_package.run_command
195
194
  app_package.error!
195
+ begin
196
+ verify
197
+ rescue Mixlib::ShellOut::ShellCommandFailed => e
198
+ if remaining_attempts > 0
199
+ package(remaining_attempts - 1)
200
+ else
201
+ raise
202
+ end
203
+ end
196
204
  end
197
205
 
198
206
  def verify
@@ -84,6 +84,14 @@ module Pkgr
84
84
  method_option :after_install,
85
85
  :type => :string,
86
86
  :desc => "Provide a script to run just after a package gets installated or updated, on the target machine."
87
+ #Before and after Remove
88
+ method_option :before_remove,
89
+ :type => :string,
90
+ :desc => "Provide a script to run just before a package gets uninstallated, on the target machine."
91
+ method_option :after_remove,
92
+ :type => :string,
93
+ :desc => "Provide a script to run just after a package gets uninstallated, on the target machine."
94
+
87
95
  method_option :dependencies,
88
96
  :type => :array,
89
97
  :default => [],
@@ -74,9 +74,9 @@ module Pkgr
74
74
  class DebianFpmCommand < FpmCommand
75
75
  def args
76
76
  list = super
77
- list << "-t deb"
78
- list << %{--deb-user "root"}
79
- list << %{--deb-group "root"}
77
+ list << "-t" << "deb"
78
+ list << "--deb-user" << "root"
79
+ list << "--deb-group" << "root"
80
80
  list
81
81
  end
82
82
  end
@@ -35,7 +35,7 @@ module Pkgr
35
35
  class FedoraFpmCommand < FpmCommand
36
36
  def args
37
37
  list = super
38
- list << "-t rpm"
38
+ list << "-t" << "rpm"
39
39
  list
40
40
  end
41
41
  end
@@ -35,7 +35,7 @@ module Pkgr
35
35
  class SlesFpmCommand < FpmCommand
36
36
  def args
37
37
  list = super
38
- list << "-t rpm"
38
+ list << "-t" << "rpm"
39
39
  list
40
40
  end
41
41
  end
@@ -1,3 +1,5 @@
1
+ require 'shellwords'
2
+
1
3
  module Pkgr
2
4
  class FpmCommand
3
5
  attr_reader :distribution, :build_dir, :config
@@ -9,32 +11,32 @@ module Pkgr
9
11
  end
10
12
 
11
13
  def command
12
- %{fpm #{args.join(" ")} .}
14
+ %{fpm #{Shellwords.join(args)} .}
13
15
  end
14
16
 
15
17
  def args
16
18
  list = []
17
- list << "-s dir"
19
+ list << "-s" << "dir"
18
20
  list << "--verbose"
19
21
  list << "--force"
20
- list << "--exclude '**/.git**'"
21
- list << %{-C "#{build_dir}"}
22
- list << %{-n "#{config.name}"}
23
- list << %{--version "#{config.version}"}
24
- list << %{--iteration "#{config.iteration}"}
25
- list << %{--url "#{config.homepage}"}
26
- list << %{--provides "#{config.name}"}
27
- list << %{--license "#{config.license}"} unless config.license.nil?
28
- list << %{-a "#{config.architecture}"}
29
- list << %{--description "#{config.description}"}
30
- list << %{--maintainer "#{config.maintainer}"}
31
- list << %{--vendor "#{config.vendor}"}
22
+ list << "--exclude" << "**/.git**"
23
+ list << "-C" << build_dir
24
+ list << "-n" << config.name
25
+ list << "--version" << config.version
26
+ list << "--iteration" << config.iteration
27
+ list << "--url" << config.homepage
28
+ list << "--provides" << config.name
29
+ list << "--license" << config.license unless config.license.nil?
30
+ list << "-a" << config.architecture
31
+ list << "--description" << config.description
32
+ list << "--maintainer" << config.maintainer
33
+ list << "--vendor" << config.vendor
32
34
  list << %{--template-scripts}
33
- list << %{--before-install #{distribution.preinstall_file}}
34
- list << %{--after-install #{distribution.postinstall_file}}
35
- list << %{--before-remove #{distribution.preuninstall_file}}
36
- list << %{--after-remove #{distribution.postuninstall_file}}
37
- distribution.dependencies(config.dependencies).each{|d| list << "-d '#{d}'"}
35
+ list << "--before-install" << distribution.preinstall_file
36
+ list << "--after-install" << distribution.postinstall_file
37
+ list << "--before-remove" << distribution.preuninstall_file
38
+ list << "--after-remove" << distribution.postuninstall_file
39
+ distribution.dependencies(config.dependencies).each{|d| list << "-d" << d}
38
40
  list.compact
39
41
  end
40
42
  end
@@ -1,3 +1,3 @@
1
1
  module Pkgr
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pkgr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Rohr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-17 00:00:00.000000000 Z
11
+ date: 2015-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '10.3'
19
+ version: '10.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '10.3'
26
+ version: '10.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement