gitlab_mr_release 0.1.0.beta1 → 0.1.0.beta2

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: e74b91dbe20ff578ba041452848e85f244ba6403
4
- data.tar.gz: 4789e5d235e1ac0b995ac55618b6375dfe7ca65e
3
+ metadata.gz: 0e3ccad87a77033a4bb9d52a7659a8d2cec2cb7a
4
+ data.tar.gz: 0fe70b8ad3087944132fd916fc5056b35a974c7b
5
5
  SHA512:
6
- metadata.gz: f9e8c3f964cf68c570c69fb8f1b95d0e2b21c4a6439eef3ee62a8b847a3f31f1e709abc8c9051e65d637d1c9032ec1fef8a719380f7c707c1f7f485537b46a29
7
- data.tar.gz: 5b60391374b30970d5599d53e1e8bfb204e1093e5ae22ff5189736fa4f19e65458adc9446fca503c4da4eaf2293ec81b1c04ca0245da4b503f3401df7c2c8f84
6
+ metadata.gz: fc99f6871650721600de5838716d306ffc7caeac5e18a3900725e9dfd069136690ee7751fb774a360a81f4fba856be665d218f1b6f8314e9dd1936486cacfcaa
7
+ data.tar.gz: 1509faace0e285679b856b0a181c9b6a13f2d21f87d05357a89717dc19b1246e6dddc2dabe268bd66e8a8f76719e1e12c8356ed2c422f1f6c2b936310033712a
@@ -35,6 +35,12 @@ module GitlabMrRelease
35
35
  option :target, aliases: "-t", required: true, desc: "Target branch (e.g. master)"
36
36
  option :title, desc: "MergeRequest title (default. 'Release :source -> :target')"
37
37
  def create
38
+ Dotenv.load(*GITLAB_ENV_FILES)
39
+
40
+ assert_env("GITLAB_API_ENDPOINT")
41
+ assert_env("GITLAB_API_PRIVATE_TOKEN")
42
+ assert_env("GITLAB_PROJECT_NAME")
43
+
38
44
  title = options[:title] || default_title
39
45
 
40
46
  template =
@@ -59,6 +65,13 @@ module GitlabMrRelease
59
65
 
60
66
  private
61
67
 
68
+ def assert_env(name)
69
+ unless ENV[name]
70
+ puts "Error: Environment variable #{name} is required"
71
+ exit!
72
+ end
73
+ end
74
+
62
75
  def default_title
63
76
  "Release #{options[:source]} -> #{options[:target]}"
64
77
  end
@@ -1,3 +1,3 @@
1
1
  module GitlabMrRelease
2
- VERSION = "0.1.0.beta1"
2
+ VERSION = "0.1.0.beta2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab_mr_release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.beta1
4
+ version: 0.1.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445