lab2hub 0.1.1 → 0.2.0
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/README.md +39 -1
- data/exe/lab2hub +19 -1
- data/lib/lab2hub/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: e6b2261e9f65800ed1a08bc593cf0c1ba955ca59
|
4
|
+
data.tar.gz: 975cb694ea3f9b715ac03618abafd625da052ed7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 018838f96e784d612462539860f8e19eb3c68207dd6565dc064ed8c95cc4ac4d1744cc70139aa17d21e21c7a2cdbdc78672ee1183e53e2dc68e1df55e3eb301c
|
7
|
+
data.tar.gz: 3a3eb76e2ca89a0747de9ce367465e461448b15d41b956a892bf5b1e04c93aefe73d33cef68a9e50a4cb1be38d4a9d487c2bf3be9057f139afd3b1d18e26e18d
|
data/README.md
CHANGED
@@ -3,15 +3,53 @@
|
|
3
3
|
|
4
4
|
Easily migrate your projects from GitLab to GitHub.
|
5
5
|
|
6
|
-
##
|
6
|
+
## Installation
|
7
7
|
|
8
8
|
```sh
|
9
9
|
gem install lab2hub
|
10
|
+
```
|
11
|
+
|
12
|
+
## Usage
|
13
|
+
|
14
|
+
```sh
|
10
15
|
lab2hub --config
|
11
16
|
vi config.yaml
|
12
17
|
lab2hub PROJECT_NAME_ON_GITLAB
|
13
18
|
```
|
14
19
|
|
20
|
+
## Features
|
21
|
+
|
22
|
+
lab2hub migrates your:
|
23
|
+
|
24
|
+
- Project's title, description, visibility (public or private), and git repository.
|
25
|
+
- Issues with comments
|
26
|
+
|
27
|
+
### Work In Progress (WIP)
|
28
|
+
|
29
|
+
- Attachments in issue notes(comments)
|
30
|
+
- Milestones
|
31
|
+
- Labels
|
32
|
+
- Wiki
|
33
|
+
|
34
|
+
### config.yaml
|
35
|
+
|
36
|
+
`config.yaml` file contains the private access tokens for GitHub and GitLab,
|
37
|
+
and those tokens are neccessary to access your private repositories on GitLab and
|
38
|
+
create new repositories on GitHub.
|
39
|
+
|
40
|
+
Create `config.yaml` file in the currently working with `lab2hub --config`, and
|
41
|
+
open the file with an text editor, and then replace `GITHUB_PERSONAL_ACCESS_TOKEN` and `GITLAB_PRIVATE_TOKEN` with your own tokens:
|
42
|
+
|
43
|
+
```yaml
|
44
|
+
github: GITHUB_PERSONAL_ACCESS_TOKEN
|
45
|
+
gitlab: GITLAB_PRIVATE_TOKEN
|
46
|
+
```
|
47
|
+
|
48
|
+
Access tokens can be generated and obtained from here:
|
49
|
+
|
50
|
+
- GitHub: https://github.com/settings/tokens
|
51
|
+
- GitLab: https://gitlab.com/profile/account
|
52
|
+
|
15
53
|
## Development
|
16
54
|
|
17
55
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/exe/lab2hub
CHANGED
@@ -87,7 +87,7 @@ begin
|
|
87
87
|
puts %x(#{cmd} "#{arg1}" "#{arg2}" "#{arg3}")
|
88
88
|
|
89
89
|
# Migrate issues
|
90
|
-
Gitlab.issues(project.id).auto_paginate.each do |issue|
|
90
|
+
Gitlab.issues(project.id).auto_paginate.reverse.each do |issue|
|
91
91
|
puts '-' * 80
|
92
92
|
pp issue
|
93
93
|
created = github.issues.create({
|
@@ -98,6 +98,24 @@ begin
|
|
98
98
|
labels: issue.labels
|
99
99
|
})
|
100
100
|
pp created
|
101
|
+
|
102
|
+
# Issue notes (comments)
|
103
|
+
notes = Gitlab.issue_notes(project.id, issue.id).auto_paginate
|
104
|
+
|
105
|
+
notes.select! do |note|
|
106
|
+
note.body != 'Status changed to closed' && note.body != 'Status changed to reopened'
|
107
|
+
end
|
108
|
+
|
109
|
+
# Sort by
|
110
|
+
notes.each do |note|
|
111
|
+
github.issues.comments.create({
|
112
|
+
user: repo.owner.login,
|
113
|
+
repo: repo.name,
|
114
|
+
number: created.number,
|
115
|
+
body: note.body
|
116
|
+
})
|
117
|
+
end
|
118
|
+
|
101
119
|
if issue.state == 'closed'
|
102
120
|
github.issues.edit({
|
103
121
|
user: repo.owner.login,
|
data/lib/lab2hub/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lab2hub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- buo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|