soaring 0.1.17 → 0.1.18
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 +4 -4
- data/lib/soaring/packager.rb +21 -5
- data/lib/soaring/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91f3db3f3699654ab86dfd0b4c525f2af47a6fff
|
4
|
+
data.tar.gz: c7f25974430839bcdf163a6377e19a8ad21a552c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c814065b0f343aeaf9ff8adea5fd768c5d87c380d48d5f6de7c3a85b163edda6d4f30f453830d77b9cdf31e4fe70c1d2ce5389cbc798d65bbb2f4d0b146b1c7
|
7
|
+
data.tar.gz: 1d528e82a2170f9c2bb092c0b05ac051d436e936e0254cfa4ab1c9bbaeab0edbc23a51dc74ea20687d9381365755d62652c1775a98a4d19dcaa5ebe8bde71bfb
|
data/lib/soaring/packager.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
1
3
|
module Soaring
|
2
4
|
class Packager
|
3
5
|
def initialize(options)
|
@@ -8,7 +10,7 @@ module Soaring
|
|
8
10
|
Dir.chdir(@options[:project_root]) do
|
9
11
|
validate_project if not @options[:ignore_git_checks]
|
10
12
|
build_output_location = generate_build_output_location(@options[:project_root])
|
11
|
-
|
13
|
+
update_project_release_information
|
12
14
|
`mkdir -p #{@options[:project_root]}/build`
|
13
15
|
`zip -r #{build_output_location} * .ebextensions --exclude=build/* --exclude=config/environment.yml`
|
14
16
|
puts "Build packaged at #{build_output_location}"
|
@@ -31,12 +33,26 @@ module Soaring
|
|
31
33
|
"#{project_folder}/build/build_#{service_name}_#{get_short_commit_hash}_#{timestamp}.zip"
|
32
34
|
end
|
33
35
|
|
34
|
-
def
|
35
|
-
|
36
|
-
|
37
|
-
|
36
|
+
def update_project_release_information
|
37
|
+
release_information = { 'commit_hash' => get_git_commit_hash,
|
38
|
+
'commit_date' => get_git_commit_date }
|
39
|
+
File.open(".release_information", "w") do |file|
|
40
|
+
file.write release_information.to_yaml
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def get_git_commit_hash
|
45
|
+
git_hash = `git rev-parse HEAD`.chomp
|
46
|
+
git_hash = /\A[0-9a-f]{5,40}\z/.match(git_hash)
|
47
|
+
if git_hash.nil?
|
48
|
+
$stderr.puts 'Failed to package, unable to get commit hash from local git repository'
|
38
49
|
exit 1
|
39
50
|
end
|
51
|
+
git_hash[0]
|
52
|
+
end
|
53
|
+
|
54
|
+
def get_git_commit_date
|
55
|
+
`git show -s --format=%cI`.chomp
|
40
56
|
end
|
41
57
|
|
42
58
|
def is_git_repo_up_to_date?
|
data/lib/soaring/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Barney de Villiers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|