roger_sneakpeek 0.0.2 → 0.0.3

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: 70162624ceee9f92e6bd294ae36f17b081d66cf8
4
- data.tar.gz: 502973a372ab229448e2ffeb821f473620eb847a
3
+ metadata.gz: fabd70b50930cfdeb776fb1295dde4db3d462124
4
+ data.tar.gz: 0262a704c6751f09a98622566c20b9985cb905a9
5
5
  SHA512:
6
- metadata.gz: a15c6ecf8ffdb0c45c52d67951344d958cb6329ef9e45d1b6a6e95f3e170a84683f5da56344fdc75ffe9f91ffa28ad36ec28bb37b42d98cc9a9b8bc5ad32cecc
7
- data.tar.gz: 3d0918fa6ad182484c0b4fb57af7009f6484d580bcae29bb13ba336f881358fa4284a7b8a13e5a7e39cbbd98dc55d0dc1a896663f5088ce67444797b9ec2ea97
6
+ metadata.gz: a7591fdbd1d2b8c4a682db88f83564aee0812e20b0818554f267c1c85968eaba47dac49e76aece5b2c80c5a6caf16212166e6f294d2676c552edaecf8654311e
7
+ data.tar.gz: 08efcb0016a91b3587740e2491338ad8c3141f15b3bd654a47fbc13cf4e70dfa03e0562c50af90445652b0c8c7d2f79f9f87e2904904f2c1e6e856669bf1e9cd
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.3
4
+ * Add CI specific git info class
5
+
3
6
  ## 0.0.2
4
7
  * Only match exact git tags
5
8
 
@@ -0,0 +1,23 @@
1
+ module RogerSneakpeek
2
+ # Get relevant git info
3
+ class CI
4
+ # Are we running in CI?
5
+ def self.ci?
6
+ ENV["CI"]
7
+ end
8
+
9
+ def tag
10
+ ENV["CI_BUILD_TAG"]
11
+ end
12
+
13
+ def sha
14
+ ENV["CI_BUILD_REF"]
15
+ end
16
+
17
+ # Will return current branch or tag
18
+ # in CI mode.
19
+ def branch
20
+ ENV["CI_BUILD_REF_NAME"]
21
+ end
22
+ end
23
+ end
@@ -6,6 +6,7 @@ require "uri"
6
6
  require "json"
7
7
 
8
8
  require File.dirname(__FILE__) + "/git"
9
+ require File.dirname(__FILE__) + "/ci"
9
10
 
10
11
  module RogerSneakpeek
11
12
  # Finalizer to zip and upload release
@@ -32,7 +33,7 @@ module RogerSneakpeek
32
33
  end
33
34
 
34
35
  # If we run in ci_only mode and are not in CI we stop.
35
- return if options[:ci_only] && !ENV["CI"]
36
+ return if options[:ci_only] && !CI.ci?
36
37
 
37
38
  @release = release
38
39
  @current_options = options
@@ -72,7 +73,11 @@ module RogerSneakpeek
72
73
  end
73
74
 
74
75
  def upload_release(zip_path)
75
- git = Git.new(path: release.project.path)
76
+ if CI.ci?
77
+ git = CI.new()
78
+ else
79
+ git = Git.new(path: release.project.path)
80
+ end
76
81
 
77
82
  data = perform_upload(
78
83
  sneakpeek_url(git),
@@ -1,4 +1,4 @@
1
1
  # Roger main namespace
2
2
  module RogerSneakpeek
3
- VERSION = "0.0.2".freeze
3
+ VERSION = "0.0.3".freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roger_sneakpeek
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flurin Egger
@@ -137,6 +137,7 @@ files:
137
137
  - README.md
138
138
  - Rakefile
139
139
  - lib/roger_sneakpeek.rb
140
+ - lib/roger_sneakpeek/ci.rb
140
141
  - lib/roger_sneakpeek/finalizer.rb
141
142
  - lib/roger_sneakpeek/git.rb
142
143
  - lib/roger_sneakpeek/version.rb