gitlab_mr_release 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.env.gitlab.example +1 -1
- data/CHANGELOG.md +7 -1
- data/README.md +1 -1
- data/lib/gitlab_mr_release/project.rb +14 -3
- data/lib/gitlab_mr_release/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: 67432e6eaa9cbf873418013842f565e4f946376b
|
4
|
+
data.tar.gz: 5df2a6e6d2b040de83fea5ab0b7fc2017cf0c925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52f485ef55eb97ff5f945b3bcc003f0e518a37b0d12ae88ddd61b75b0774b4e888c62ca2fff0e93c98776c09bdef2e35d548a4c3d92f94b7bf411a3860eecba5
|
7
|
+
data.tar.gz: ac6c1b1e4bc9b10ebc89d9d21a53637c5784709bf56b4b3146a7a1c800dcda60e541e6510862173353dde856b5223140fc87682da5fdd4e91e31f7c66bae20b0
|
data/.env.gitlab.example
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
## Unreleased
|
2
|
-
[full changelog](http://github.com/sue445/gitlab_mr_release/compare/v0.
|
2
|
+
[full changelog](http://github.com/sue445/gitlab_mr_release/compare/v0.4.0...master)
|
3
|
+
|
4
|
+
## v0.4.0
|
5
|
+
[full changelog](http://github.com/sue445/gitlab_mr_release/compare/v0.3.1...v0.4.0)
|
6
|
+
|
7
|
+
* Support GitLab API v4
|
8
|
+
* https://github.com/sue445/gitlab_mr_release/pull/19
|
3
9
|
|
4
10
|
## v0.3.1
|
5
11
|
[full changelog](http://github.com/sue445/gitlab_mr_release/compare/v0.3.0...v0.3.1)
|
data/README.md
CHANGED
@@ -88,7 +88,7 @@ Environment variables read from `~/.env.gitlab` and current `.env.gitlab`
|
|
88
88
|
`~/.env.gitlab`
|
89
89
|
|
90
90
|
```
|
91
|
-
GITLAB_API_ENDPOINT=http://example.com/api/
|
91
|
+
GITLAB_API_ENDPOINT=http://example.com/api/v4
|
92
92
|
GITLAB_API_PRIVATE_TOKEN=XXXXXXXXXXXXXXXXXXX
|
93
93
|
TEMPLATE_FILE=gitlab_mr_release.md.erb
|
94
94
|
DEFAULT_TITLE=Release <%= Time.now %> <%= source_branch %> -> <%= target_branch %>
|
@@ -10,6 +10,7 @@ module GitlabMrRelease
|
|
10
10
|
config.endpoint = api_endpoint
|
11
11
|
config.private_token = private_token
|
12
12
|
end
|
13
|
+
@api_endpoint = api_endpoint
|
13
14
|
@project_name = project_name
|
14
15
|
end
|
15
16
|
|
@@ -31,9 +32,15 @@ module GitlabMrRelease
|
|
31
32
|
|
32
33
|
# find MergeRequest with iid
|
33
34
|
def merge_request(iid)
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
if api_v4?
|
36
|
+
# API v4
|
37
|
+
Gitlab.merge_request(@project_name, iid)
|
38
|
+
else
|
39
|
+
# API v3
|
40
|
+
mr = Gitlab.merge_requests(@project_name, iid: iid).first
|
41
|
+
assert_merge_request_iid(mr, iid) if mr
|
42
|
+
mr
|
43
|
+
end
|
37
44
|
end
|
38
45
|
|
39
46
|
def generate_description(iids, template)
|
@@ -58,5 +65,9 @@ module GitlabMrRelease
|
|
58
65
|
# NOTE: MR is found, but server is old GitLab?
|
59
66
|
raise "MergeRequest iid does not match (expected #{iid}, but #{mr.iid})" unless iid == mr.iid
|
60
67
|
end
|
68
|
+
|
69
|
+
def api_v4?
|
70
|
+
@api_endpoint =~ %r(/api/v4/?)
|
71
|
+
end
|
61
72
|
end
|
62
73
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab_mr_release
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dotenv
|