source_install 1.0.1 → 1.1.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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/source_install.rb +15 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f5dd771ee8f61064280dd811e0171328f49e70a003e4134cfe3c1c41c8c66ac
4
- data.tar.gz: '0159fb7d6ee238b0dc702380414d98088a6cfface3187fa5e8bfd21e21052081'
3
+ metadata.gz: 0eb0653df730edc3207daab89e62f9393e1101d2842ff066cf28b6fb183c015c
4
+ data.tar.gz: 92b9c77b8ff26f28f2afe8a25cda5b1b3a281ade77de02eba39b00063cc6912b
5
5
  SHA512:
6
- metadata.gz: da820274d847dc5cb508f0b4a92c4cc15085e408e112b80acf3919aa3ee585a7c07d64bbfcb7bd51416d0f6639b6e0ec7654d7edb8d4e03f72c27ddf4303cba7
7
- data.tar.gz: 63a8a15a57777b9f835dae093a9a32cf9d1a33c57180feedc922e774771c7738cbea3fb7f8884b21bb4f9d915f344c9a4c9f2d8f69478b936d53cc590cf28098
6
+ metadata.gz: 02cca226b237e8fb00430486a6e9c1af8af22e90d36704c533c18ee03e0f77f6b029593a0326377ec7959ed7a05db210de5d76fecbfd405e4b2e1d9708eb6e02
7
+ data.tar.gz: 732d67b245660f9736dbc985614723864c6037a52fc43ecc26d3b069c364536588613c7128872648c9e25a81ee76e054376c2bfbe837e2c0b992e96f45311104
@@ -4,7 +4,7 @@
4
4
  module Source
5
5
  # This module implements helpers that are used for resources
6
6
  module Install
7
- VERSION = '1.0.1'
7
+ VERSION = '1.1.0'
8
8
 
9
9
  # Hooks for install
10
10
 
@@ -53,8 +53,18 @@ e.g. "bin/my_app"')
53
53
  raise NotImplementedError('Client must define the command for installation, e.g. "make install"')
54
54
  end
55
55
 
56
+ # Optional hooks for install
57
+
56
58
  def post_install_logic(_new_resource)
57
- raise NotImplementedError('Client must define logic to run after installation, for example to creating symlinks')
59
+ # Client may define logic to run after installation, for example for creating symlinks
60
+ end
61
+
62
+ def config_creates_file(_new_resource)
63
+ # A relative path to a file created by configuration
64
+ # If the client defines a config_creates_file, then the content of that file will be used to signal rebuild
65
+ # Otherwise, a checksum is taken of the entire build directory
66
+ # A file is less robust for signaling rebuild when config changes, but cleaner for nasty in-source builds
67
+ return nil
58
68
  end
59
69
 
60
70
  # Common install code
@@ -226,8 +236,10 @@ e.g. "bin/my_app"')
226
236
  end
227
237
 
228
238
  def check_build_directory(build_directory, new_resource)
239
+ creates_file = config_creates_file(new_resource)
229
240
  checksum_file 'Source Checksum' do
230
- source_path build_directory
241
+ source_path File.join(build_directory, creates_file) if creates_file
242
+ source_path build_directory unless creates_file
231
243
  target_path "/var/chef/cache/#{base_name(new_resource).downcase}-#{new_resource.version}-src-checksum"
232
244
  end
233
245
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: source_install
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - UA OIT Systems Engineering
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-27 00:00:00.000000000 Z
11
+ date: 2019-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler