s3_website 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9175154b8b9b1982291616351c8540b0dee659c
4
- data.tar.gz: cf87ecd7a6f989c21c98699d9ce6b43fdf025e6a
3
+ metadata.gz: 59c642cd9caf480db7c459c0afc1cce75fbd2607
4
+ data.tar.gz: 8d89f4fe66225d5d9e13ca6f31061aa346aa5fa3
5
5
  SHA512:
6
- metadata.gz: 5fce5e66cd6fe88902ec1d01441387e8d4bf725420face8c6e2ac8aaeaa226613b19fae7d476b3afa95807e611cb45492e565d385742599f4399cea8e9c8497f
7
- data.tar.gz: 105be5233f7d9dc11f704f07e3e0878059751e3e1af3162fe86e51e5fa34a26d5b94437264ff55ddbc9147a0713ae11e990ae6e7f637a8965f222e6e16f90b70
6
+ metadata.gz: 1936d48506991ef66a6237fff4ae563c1c47a26c0721af565cfd4a27c7626d48cbd389a88ace698ef5119808cb8c344c94ca75b9387d8d71e5f71c654a066711
7
+ data.tar.gz: 186650b5b8629ae6136d722226c178a148e8bbd640a5d4fbd964cc0b702ba78f9a54e20627815935289379bb6ec9462f8791a780925a157509dc8f71529acd53
data/.gitignore CHANGED
@@ -9,3 +9,7 @@ Gemfile.lock
9
9
  target
10
10
  .idea_modules
11
11
  .vagrant
12
+
13
+ # The checksum is unique to each build, and we don't store builds in git.
14
+ # Consequently, ignore the checksum file.
15
+ resources/s3_website.jar.md5
@@ -2,6 +2,7 @@
2
2
 
3
3
  require File.expand_path(File.dirname(__FILE__)+ '/../lib/s3_website')
4
4
  require 'colored'
5
+ require 'digest/md5'
5
6
 
6
7
  class Cfg < Thor
7
8
  desc 'create', 'Create a config file with placeholder values'
@@ -157,8 +158,18 @@ def resolve_jar(project_root, logger)
157
158
  File.exists? jar_path
158
159
  }.
159
160
  first
161
+ def jar_has_valid_checksum(jar_path, logger)
162
+ expected_checksum = File.read(File.dirname(__FILE__) + '/../resources/s3_website.jar.md5')
163
+ found_checksum = Digest::MD5.file(jar_path).hexdigest
164
+ if expected_checksum == found_checksum
165
+ true
166
+ else
167
+ logger.info_msg "The jar file has invalid checksum. Expected #{expected_checksum} but got #{found_checksum}"
168
+ false
169
+ end
170
+ end
160
171
  jar_file =
161
- if found_jar
172
+ if found_jar and jar_has_valid_checksum(found_jar, logger)
162
173
  found_jar
163
174
  else
164
175
  is_development = File.exists?(project_root + '/.git')
@@ -2,6 +2,10 @@
2
2
 
3
3
  This project uses [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## 2.1.1
6
+
7
+ * Verify that the s3_website.jar is not corrupted. Download it again, if it is.
8
+
5
9
  ## 2.1.0
6
10
 
7
11
  * Show the upload reason when calling `push --verbose`
@@ -1,3 +1,3 @@
1
1
  module S3Website
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
data/release CHANGED
@@ -16,9 +16,14 @@ def run(cmd)
16
16
  end
17
17
 
18
18
  puts "Building s3_website.jar..."
19
+ jar_location = 'target/scala-2.11/s3_website.jar'
19
20
  run "./sbt clean"
20
21
  run "./sbt assembly"
21
22
 
23
+ # The bin s3_website uses the MD5 checksum to verify that the jar is not corrupted
24
+ jar_md5 = Digest::MD5.file(jar_location).hexdigest
25
+ File.write('resources/s3_website.jar.md5', jar_md5)
26
+
22
27
  tag_name = "v#{version}"
23
28
  run "git tag #{tag_name} && git push origin #{tag_name}"
24
29
  run "git push"
@@ -32,5 +37,5 @@ release = client.create_release(
32
37
  :body => "See https://github.com/laurilehmijoki/s3_website/blob/master/changelog.md##{version.gsub('.', '')}"
33
38
  )
34
39
  puts "Uploading s3_website.jar..."
35
- client.upload_asset(release[:url], 'target/scala-2.11/s3_website.jar')
40
+ client.upload_asset(release[:url], jar_location)
36
41
  run "gem push pkg/s3_website-#{version}.gem"
@@ -25,7 +25,10 @@ Gem::Specification.new do |s|
25
25
  s.add_development_dependency 'rake', '10.1.1'
26
26
  s.add_development_dependency 'octokit', '3.1.0'
27
27
 
28
- s.files = `git ls-files`.split("\n").reject { |f| f.match('sbt-launch.jar') }
28
+ s.files = `git ls-files`
29
+ .split("\n")
30
+ .reject { |f| f.match('sbt-launch.jar') } # Reject the SBT jar, as it is a big file
31
+ .push('resources/s3_website.jar.md5') # Include the checksum file in the gem
29
32
  s.test_files = `git ls-files -- src/test/*`.split("\n")
30
33
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
31
34
  s.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_website
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lauri Lehmijoki
@@ -123,6 +123,7 @@ files:
123
123
  - project/plugins.sbt
124
124
  - release
125
125
  - resources/configuration_file_template.yml
126
+ - resources/s3_website.jar.md5
126
127
  - s3_website.gemspec
127
128
  - sbt
128
129
  - src/main/java/s3/website/ByteHelper.java