intello-shipit-cli 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +17 -0
- data/LICENSE +2 -2
- data/README.md +44 -3
- data/lib/shipit/cli/version.rb +1 -1
- data/lib/shipit/cli/work.rb +5 -2
- data/shipit-cli.gemspec +1 -1
- data/shipit-windows.bat +60 -0
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8357db54113d84cd737edb6bf57228fa235df527fba88af7de8eecaa4d0f5d4
|
4
|
+
data.tar.gz: 3716cc73141f21833285e40a3b1b3f28199de3eae8d0133008e5b36e35015d92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63e909865718db3d151bfdaed972b7f127cd9d905ee42f5a6584849d4d5b706156ba98c795a12acfff063b4375e0762b6c2bd66de31e1e4d9a0564d095f7f8e5
|
7
|
+
data.tar.gz: 27dee93a4f8a9a667eda387f8946509708738f63c7e1cd1c29d4e48bef437a28117829d893c63c6e6a8925289deeaa3e8686df5e15266814a3b24041c768a752
|
data/Changelog.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
NOTE: the project follows [Semantic Versioning](http://semver.org/).
|
6
|
+
|
7
|
+
## Firmware
|
8
|
+
|
9
|
+
### v1.1.0 - February 7th, 2022
|
10
|
+
|
11
|
+
- [enhancement] #5 - Run shipit from a Docker environement for nonLinux environement
|
12
|
+
- [task] #1 - Support gitlab.com new Draft status
|
13
|
+
|
14
|
+
### v1.0.0 - November 25th, 2021
|
15
|
+
|
16
|
+
- Inivial version
|
17
|
+
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright Intello Technologies Inc, 2016-
|
3
|
+
Copyright Intello Technologies Inc, 2016-2020.
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -12,29 +12,64 @@ Designed to simplify collaboration with Git and Gitlab, its main purpose is to k
|
|
12
12
|
|
13
13
|
## Requirements
|
14
14
|
|
15
|
-
-
|
15
|
+
- Git
|
16
16
|
- A `gitlab` personal access token (`https://{{ YOUR_GITLAB_HOST }}/profile/personal_access_tokens`)
|
17
17
|
- Issues must have a label and a milestone
|
18
18
|
|
19
19
|
`intello-shipit-cli` works as well on gitlab.com as on a privately hosted instance of Gitlab
|
20
20
|
|
21
|
+
### Linux / macOS
|
22
|
+
|
23
|
+
- Ruby 2.5+
|
24
|
+
|
25
|
+
### Windows
|
26
|
+
|
27
|
+
- Docker
|
28
|
+
|
29
|
+
A .shipit.yml file must exist in `C:\Users\[my_user]\.shipit.yml` or to a path specified by `-c [path_to_file]`
|
30
|
+
SSH keys should be present in `C:\Users\[my_user]\.ssh`
|
31
|
+
|
32
|
+
Here is an example of the format of the file :
|
33
|
+
|
34
|
+
```yaml
|
35
|
+
---
|
36
|
+
endpoint: endpoint
|
37
|
+
private_token: private_token
|
38
|
+
```
|
39
|
+
|
40
|
+
As an example, the [endpoint for gitlab.com](https://docs.gitlab.com/ee/api/#current-status) is `https://gitlab.intello.com/api/v4`.
|
41
|
+
|
21
42
|
## Install/Update
|
22
43
|
|
44
|
+
### Linux / macOS
|
45
|
+
|
23
46
|
```bash
|
24
47
|
gem install intello-shipit-cli
|
25
48
|
```
|
26
49
|
|
27
50
|
> NOTE: If you use a ruby manager, the gem has to be installed each time you want to use it in a new ruby context.
|
28
51
|
|
29
|
-
|
52
|
+
#### PROTIP
|
30
53
|
|
31
54
|
If you use rbenv as your ruby manager, and want to easily install/update `intello-shipit-cli` across all your rubies:
|
32
55
|
|
33
56
|
1. Install [rbenv-each](https://github.com/rbenv/rbenv-each)
|
34
57
|
1. Run `rbenv each gem install intello-shipit-cli`
|
35
58
|
|
59
|
+
### Windows
|
60
|
+
|
61
|
+
Move `shipit-windows.bat` to a folder present in your environment %PATH%.
|
62
|
+
shipit-windows.bat needs to be run from a gitlab project.
|
63
|
+
|
64
|
+
#### Known issues
|
65
|
+
|
66
|
+
- Virtualization may not be enabled on certain AMD processors.
|
67
|
+
- From our experience, You may need to update to Windows build 2004 and re-install Docker or Docker Desktop to fix the above mentionned issue.
|
68
|
+
|
36
69
|
## Setup
|
37
70
|
|
71
|
+
### Linux
|
72
|
+
|
38
73
|
You must first setup `intello-shipit-cli` by running:
|
39
74
|
|
40
75
|
```bash
|
@@ -48,6 +83,12 @@ This will interactivly ask you for:
|
|
48
83
|
|
49
84
|
The setup will create a file in your user root folder called `.shipit.yml` with this information.
|
50
85
|
|
86
|
+
### Windows
|
87
|
+
|
88
|
+
You must manually set up your `.shipit.yml` file in your home directory : `C:\Users\[your_user]\.shipit.yml`
|
89
|
+
Setup will be performed when you first run `shipit-windows.bat`.
|
90
|
+
First time use may take a few minutes to configure its Docker environment.
|
91
|
+
|
51
92
|
### PROTIP
|
52
93
|
|
53
94
|
If you have multiple Gitlab servers or account you can manually create configuration YAML files and use the `-c` option of `intello-shipit-cli` to select the proper configuration.
|
@@ -138,7 +179,7 @@ You can write tests using `rspec v3+` syntax in the `spec` folder. To run the te
|
|
138
179
|
|
139
180
|
## License
|
140
181
|
|
141
|
-
Copyright Intello Technologies Inc, 2016-
|
182
|
+
Copyright Intello Technologies Inc, 2016-2020. Licensed under the [MIT license](/LICENSE?raw=true).
|
142
183
|
|
143
184
|
## About Intello Technologies Inc.
|
144
185
|
|
data/lib/shipit/cli/version.rb
CHANGED
data/lib/shipit/cli/work.rb
CHANGED
@@ -63,7 +63,10 @@ module Shipit
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def create_merge_request(issue)
|
66
|
-
|
66
|
+
if dry_run?
|
67
|
+
puts " - Merge request name: #{issue["merge_request_title"]}"
|
68
|
+
return
|
69
|
+
end
|
67
70
|
opts = issue.slice("source_branch", "target_branch", "assignee_id", "labels", "milestone_id", "remove_source_branch")
|
68
71
|
client.create_merge_request(project_path,
|
69
72
|
issue["merge_request_title"],
|
@@ -92,7 +95,7 @@ module Shipit
|
|
92
95
|
assignee_id = assignee["id"]
|
93
96
|
issue_title = sane_title.parameterize[0..20]
|
94
97
|
first_commit_message = "[#{labels}] Fixes ##{issue_id} - #{sane_title}"
|
95
|
-
mr_title = "
|
98
|
+
mr_title = "Draft: [#{labels}] ##{issue_id} - #{sane_title}"
|
96
99
|
|
97
100
|
# 2. Add to issue properties
|
98
101
|
issue["source_branch"] = [issue["labels"].first.gsub(/\s+/, ""), assignee_initials, issue_id, issue_title].compact.join("-")
|
data/shipit-cli.gemspec
CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_dependency "gli", "~> 2.13"
|
24
24
|
spec.add_dependency "gitlab", "~> 4.3.0"
|
25
25
|
|
26
|
-
spec.add_development_dependency "bundler", "~> 2.0
|
26
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
27
27
|
spec.add_development_dependency "guard"
|
28
28
|
spec.add_development_dependency "guard-ctags-bundler"
|
29
29
|
spec.add_development_dependency "guard-rspec"
|
data/shipit-windows.bat
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
@echo off
|
2
|
+
|
3
|
+
docker info > NUL 2>&1
|
4
|
+
|
5
|
+
REM Checks if docker is running or not
|
6
|
+
if errorlevel 1 (
|
7
|
+
echo Please install or start Docker
|
8
|
+
exit /b 1
|
9
|
+
)
|
10
|
+
|
11
|
+
REM If a -c flag is passed as the first argument
|
12
|
+
IF [%1] == [-c] (
|
13
|
+
|
14
|
+
REM If the file doesn't exist, stop here
|
15
|
+
IF [%2] NEQ [] (
|
16
|
+
IF NOT EXIST "%2" (
|
17
|
+
echo %2 - File does not exist
|
18
|
+
exit /b 1
|
19
|
+
)
|
20
|
+
)
|
21
|
+
|
22
|
+
REM Otherwise copy the config file to WORKDIR of container
|
23
|
+
xcopy /y %2 . > NUL 2>&1
|
24
|
+
)
|
25
|
+
|
26
|
+
REM Create temp dockerfile
|
27
|
+
(
|
28
|
+
echo FROM ruby:2.5
|
29
|
+
echo RUN gem install intello-shipit-cli
|
30
|
+
echo WORKDIR /usr/src/project
|
31
|
+
) > %TEMP%\Dockerfile
|
32
|
+
|
33
|
+
REM Check if Ruby container already is installed locally
|
34
|
+
docker inspect --type=image ruby:2.5 > NUL 2>&1
|
35
|
+
|
36
|
+
IF errorlevel 1 (
|
37
|
+
ECHO Please wait while we perform a first-time setup for shipit on your Windows environment. This can take several minutes.
|
38
|
+
)
|
39
|
+
|
40
|
+
REM Build Container
|
41
|
+
docker build -t "shipit-docker" -f %TEMP%\Dockerfile . > NUL 2>&1
|
42
|
+
|
43
|
+
REM Depending on is -c was passed, use the right arg number to run container
|
44
|
+
IF [%1] == [-c] (
|
45
|
+
docker run -v %CD%:/usr/src/project ^
|
46
|
+
-v %HOMEDRIVE%%HOMEPATH%"\authorized_keys":/root/.ssh/authorized_keys ^
|
47
|
+
-v %HOMEDRIVE%%HOMEPATH%"\.gitconfig":/root/.gitconfig ^
|
48
|
+
-v %HOMEDRIVE%%HOMEPATH%"\.ssh":/root/ssh_temp/ ^
|
49
|
+
--rm shipit-docker:latest /bin/bash -c "cp -f /root/ssh_temp/* /root/.ssh/ ; chmod 0600 /root/.ssh/* ; shipit -c .shipit.yml %3 %4"
|
50
|
+
del .shipit.yml
|
51
|
+
) else (
|
52
|
+
docker run -v %CD%:/usr/src/project ^
|
53
|
+
-v %HOMEDRIVE%%HOMEPATH%"\authorized_keys":/root/.ssh/authorized_keys ^
|
54
|
+
-v %HOMEDRIVE%%HOMEPATH%"\.gitconfig":/root/.gitconfig ^
|
55
|
+
-v %HOMEDRIVE%%HOMEPATH%"\.ssh":/root/ssh_temp/ ^
|
56
|
+
-v %HOMEDRIVE%%HOMEPATH%"\.shipit.yml":/root/.shipit.yml ^
|
57
|
+
--rm shipit-docker:latest /bin/bash -c "cp -f /root/ssh_temp/* /root/.ssh/ ; chmod 0600 /root/.ssh/* ; shipit -c /root/.shipit.yml %1 %2"
|
58
|
+
)
|
59
|
+
|
60
|
+
del %TEMP%\Dockerfile
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intello-shipit-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Thouret
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.0
|
61
|
+
version: '2.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 2.0
|
68
|
+
version: '2.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: guard
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,6 +193,7 @@ files:
|
|
193
193
|
- ".rubocop.yml"
|
194
194
|
- ".ruby-style.yml"
|
195
195
|
- ".ruby-version"
|
196
|
+
- Changelog.md
|
196
197
|
- Gemfile
|
197
198
|
- Guardfile
|
198
199
|
- LICENSE
|
@@ -215,6 +216,7 @@ files:
|
|
215
216
|
- script/release
|
216
217
|
- script/test
|
217
218
|
- shipit-cli.gemspec
|
219
|
+
- shipit-windows.bat
|
218
220
|
homepage: https://gitlab.com/intello/shipit-cli
|
219
221
|
licenses:
|
220
222
|
- MIT
|
@@ -234,8 +236,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
236
|
- !ruby/object:Gem::Version
|
235
237
|
version: '0'
|
236
238
|
requirements: []
|
237
|
-
|
238
|
-
rubygems_version: 2.7.8
|
239
|
+
rubygems_version: 3.2.3
|
239
240
|
signing_key:
|
240
241
|
specification_version: 4
|
241
242
|
summary: Designed to simplify working with Gitlab, its main purpose is to kickstart
|