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 +4 -4
- data/lib/gitlab_mr_release/cli.rb +13 -0
- data/lib/gitlab_mr_release/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e3ccad87a77033a4bb9d52a7659a8d2cec2cb7a
|
4
|
+
data.tar.gz: 0fe70b8ad3087944132fd916fc5056b35a974c7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|