fastlane-plugin-ci_changelog 0.4.1 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3d2f6bd15c17adb29be45523826cd0b95592656
4
- data.tar.gz: 8e43add1636a1f0cf774a9db915a13547ec49485
3
+ metadata.gz: fdcb44eefd9e6f75026980fa1d77a94007972b53
4
+ data.tar.gz: 9b4508e9d4f7aec967e41f0715c1cf88ba64588d
5
5
  SHA512:
6
- metadata.gz: 0fce7a15b172eb93277ced8f812c8dda8503bb677fb49f75de4f3a5a868a3f40b4c72eeeb8ca1c9404296b091d95980de7c361d248e2b0b55ccce8c9f836f9cc
7
- data.tar.gz: 52fcd274cfc9492abfe79ef434a2a3a682102cb4d379985e44afe6f0e97ea6f2ae78609e3e2abf5e71c6fd06da8e42cd5fd4460112740ee77d8b5adf7e4cb33d
6
+ metadata.gz: de157fb10a99c78e5fb76585ba9154a5eb8ce953250f389dd4f0db53d6f3415da4221b2272aa13e7f4a3d56f8bdd8668ca16b190928b7cfce3b4a6c60c866600
7
+ data.tar.gz: 3d0c62de0bd33079f17626911a05cbf7ed771048b57094c4a267db249bbe4d72aab62a274b73bda1968ff508379cb6466c73d23b7154484b44c5d2f7df8306fc
data/README.md CHANGED
@@ -20,10 +20,92 @@ Automate generate changelog between previous and the latest commit of scm during
20
20
  - [x] Gitlab CI
21
21
  - [ ] Travis CI
22
22
 
23
+ ## Configuration
24
+
25
+ ```
26
+ $ fastlane action ci_changelog
27
+ +------------------------------+---------+--------------+
28
+ | Used plugins |
29
+ +------------------------------+---------+--------------+
30
+ | Plugin | Version | Action |
31
+ +------------------------------+---------+--------------+
32
+ | fastlane-plugin-ci_changelog | 0.4.1 | ci_changelog |
33
+ +------------------------------+---------+--------------+
34
+
35
+ Loading documentation for ci_changelog:
36
+
37
+ +-----------------------------------------------------------------------------------------------+
38
+ | ci_changelog |
39
+ +-----------------------------------------------------------------------------------------------+
40
+ | Automate generate changelog between previous build failed and the latest commit of scm in CI. |
41
+ | |
42
+ | availabled with jenkins, gitlab ci, more support is comming soon. |
43
+ | |
44
+ | Created by icyleaf <icyleaf.cn@gmail.com> |
45
+ +-----------------------------------------------------------------------------------------------+
46
+
47
+ +----------------------+----------------------------------------------+-------------------------------------+---------+
48
+ | ci_changelog Options |
49
+ +----------------------+----------------------------------------------+-------------------------------------+---------+
50
+ | Key | Description | Env Var | Default |
51
+ +----------------------+----------------------------------------------+-------------------------------------+---------+
52
+ | silent | Hide all information of print table | CICL_SILENT | false |
53
+ | jenkins_user | the user of jenkins if enabled security | CICL_CHANGELOG_JENKINS_USER | |
54
+ | jenkins_token | the token or password of jenkins if enabled | CICL_CHANGELOG_JENKINS_TOKEN | |
55
+ | | security | | |
56
+ | gitlab_url | the url of gitlab | CICL_CHANGELOG_GITLAB_URL | |
57
+ | gitlab_private_token | the private token of gitlab | CICL_CHANGELOG_GITLAB_PRIVATE_TOKEN | |
58
+ +----------------------+----------------------------------------------+-------------------------------------+---------+
59
+
60
+ +----------------+--------------------------------------------------------------------------+
61
+ | ci_changelog Output Variables |
62
+ +----------------+--------------------------------------------------------------------------+
63
+ | Key | Description |
64
+ +----------------+--------------------------------------------------------------------------+
65
+ | CICL_CI | the name of CI |
66
+ | CICL_BRANCH | the name of CVS branch |
67
+ | CICL_COMMIT | the last hash of CVS commit |
68
+ | CICL_CHANGELOG | the json formatted changelog of CI (datetime, message, author and email) |
69
+ +----------------+--------------------------------------------------------------------------+
70
+ Access the output values using `lane_context[SharedValues::VARIABLE_NAME]`
71
+
72
+ ```
73
+
23
74
  ## Example
24
75
 
25
76
  Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
26
77
 
78
+ ```
79
+ $ fastlane test
80
+ [10:56:15]: Driving the lane 'test' 🚀
81
+ [10:56:15]: --------------------------
82
+ [10:56:15]: --- Step: ci_changelog ---
83
+ [10:56:15]: --------------------------
84
+ [10:56:15]: detected: gitlab ci
85
+
86
+ +-------------+------------------------------------------+
87
+ | Summary for ci_changelog 0.5.0 |
88
+ +-------------+------------------------------------------+
89
+ | ci | Jenkins |
90
+ | project_url | http://stub.ci.com/example-project |
91
+ | branch | develop |
92
+ | commit | 45e3a61db94828b2b21a93fcabf278b6ad4d9dd8 |
93
+ | changelog | id: 1234 |
94
+ | | date: 2017-11-14 16:07:08 +0800 |
95
+ | | title: Testing ... |
96
+ | | message: Details of commit |
97
+ | | author: icyleaf |
98
+ | | email: icyleaf.cn@gmail.com |
99
+ | | |
100
+ | | id: 1234 |
101
+ | | date: 2017-11-14 16:07:08 +0800 |
102
+ | | title: Testing ... |
103
+ | | message: Details of commit |
104
+ | | author: icyleaf |
105
+ | | email: icyleaf.cn@gmail.com |
106
+ +-------------+------------------------------------------+
107
+ ```
108
+
27
109
  ## Run tests for this plugin
28
110
 
29
111
  To run both the tests, and code style validation, run
@@ -15,7 +15,7 @@ module Fastlane
15
15
  JENKINS = 'Jenkins'
16
16
  GITLAB_CI = 'Gitlab CI'
17
17
  TRAVIS_CI = 'Travis CI'
18
- UNKOWEN = 'unkown'
18
+ UNKNOWN = 'Unknown'
19
19
  end
20
20
 
21
21
  class CiChangelogAction < Action
@@ -34,7 +34,7 @@ module Fastlane
34
34
  fetch_gitlab_changelog!
35
35
  fetch_gitlab_env!
36
36
  else
37
- Helper::CiChangelogHelper.store_sharedvalue(SharedValues::CICL_CI, CICLType::UNKOWEN)
37
+ Helper::CiChangelogHelper.store_sharedvalue(SharedValues::CICL_CI, CICLType::UNKNOWN)
38
38
  UI.message('Sorry, No found CI variable, maybe not support yet, available is Jenkins/Gitlab CI')
39
39
  end
40
40
 
@@ -17,8 +17,10 @@ module Fastlane
17
17
  # TODO: It must use reverse_each to correct the changelog
18
18
  commit = json['changeSet']['items'].each_with_object([]) do |item, obj|
19
19
  obj.push({
20
+ id: item['commitId'],
20
21
  date: item['date'],
21
- message: item['msg'],
22
+ title: item['msg'],
23
+ message: item['comment'],
22
24
  author: item['author']['fullName'].strip,
23
25
  email: item['authorEmail'].strip
24
26
  })
@@ -34,7 +36,9 @@ module Fastlane
34
36
  def self.dump_gitlab_commits(body)
35
37
  json = JSON.parse(body)
36
38
  commit = {
39
+ id: json['commit']['id'],
37
40
  date: json['commit']['created_at'],
41
+ title: json['commit']['title'].strip,
38
42
  message: json['commit']['message'].strip,
39
43
  author: json['commit']['author_name'].strip,
40
44
  email: json['commit']['author_email'].strip
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module CiChangelog
3
- VERSION = '0.4.1'.freeze
3
+ VERSION = '0.5.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-ci_changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - icyleaf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-26 00:00:00.000000000 Z
11
+ date: 2017-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: fastlane
85
99
  requirement: !ruby/object:Gem::Requirement