fastlane-plugin-update_jenkins_build 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 97103e6d6d332d6f40d11e45175040bad3be978c
4
+ data.tar.gz: f168d93cff6a8217f9411255047c85cfe774ff58
5
+ SHA512:
6
+ metadata.gz: 50fabbb72666689bf4ed48a44ccbc74f7ae257719532a9f4185cb72e58ff66911fc1ef14b86756c5998d5ae148549fe3a063011a8d768e671240749c4b36a3c7
7
+ data.tar.gz: 6331ce118460695e45fb2949b3a5c3693a6cae686b8bfb54bc89906d07a00a3c3185fc8f7aad598841687b1303fc7a2cc005f32c2a29ffa8edc0b50e6e15764b
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 icyleaf <icyleaf.cn@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,74 @@
1
+ # update_jenkins_build plugin
2
+
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-update_jenkins_build)
4
+
5
+ ## Getting Started
6
+
7
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-update_jenkins_build`, add it to your project by running:
8
+
9
+ ```bash
10
+ fastlane add_plugin update_jenkins_build
11
+ ```
12
+
13
+ ## About update_jenkins_build
14
+
15
+ Update build's description of jenkins.
16
+
17
+ ```
18
+ $ bundle exec fastlane action update_jenkins_build
19
+ +--------------+---------------------------------------------+-----------------------------------+---------+
20
+ | update_jenkins_build Options |
21
+ +--------------+---------------------------------------------+-----------------------------------+---------+
22
+ | Key | Description | Env Var | Default |
23
+ +--------------+---------------------------------------------+-----------------------------------+---------+
24
+ | description | the description of current build | UPDATE_JENKINS_BUILD_DESCRIPTION | |
25
+ | project | the name of project(job) | UPDATE_JENKINS_BUILD_PROJECT | |
26
+ | build_number | the build number of project(job) | UPDATE_JENKINS_BUILD_BUILD_NUMBER | |
27
+ | user | the user of jenkins if enabled security | UPDATE_JENKINS_BUILD_USER | |
28
+ | password | the password of jenkins if enabled security | UPDATE_JENKINS_BUILD_PASSWORD | |
29
+ +--------------+---------------------------------------------+-----------------------------------+---------+
30
+
31
+ +-----------------------------------+
32
+ | update_jenkins_build Return Value |
33
+ +-----------------------------------+
34
+ | ture/false |
35
+ +-----------------------------------+
36
+ ```
37
+
38
+ ## Example
39
+
40
+ 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`.
41
+
42
+ Useful with fastlane plugin:
43
+
44
+ - [app_info](https://github.com/icyleaf/fastlane-plugin-app_info) to set version.
45
+ - [ci_changelog](https://github.com/icyleaf/fastlane-plugin-ci_changelog/) to update changelogs.
46
+
47
+ ## Run tests for this plugin
48
+
49
+ To run both the tests, and code style validation, run
50
+
51
+ ```
52
+ rake
53
+ ```
54
+
55
+ To automatically fix many of the styling issues, use
56
+ ```
57
+ rubocop -a
58
+ ```
59
+
60
+ ## Issues and Feedback
61
+
62
+ For any other issues and feedback about this plugin, please submit it to this repository.
63
+
64
+ ## Troubleshooting
65
+
66
+ If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
67
+
68
+ ## Using _fastlane_ Plugins
69
+
70
+ For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
71
+
72
+ ## About _fastlane_
73
+
74
+ _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/update_jenkins_build/version'
2
+
3
+ module Fastlane
4
+ module UpdateJenkinsBuild
5
+ # Return all .rb files inside the "actions" and "helper" directory
6
+ def self.all_classes
7
+ Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
8
+ end
9
+ end
10
+ end
11
+
12
+ # By default we want to import all available actions and helpers
13
+ # A plugin can contain any number of actions and plugins
14
+ Fastlane::UpdateJenkinsBuild.all_classes.each do |current|
15
+ require current
16
+ end
@@ -0,0 +1,122 @@
1
+ require 'fastlane/action'
2
+ require_relative '../helper/update_jenkins_build_helper'
3
+ require 'http'
4
+ require 'uri'
5
+
6
+ module Fastlane
7
+ module Actions
8
+ class UpdateJenkinsBuildAction < Action
9
+ def self.run(params)
10
+ @user = params[:user]
11
+ @password = params[:password]
12
+ @project = params[:project]
13
+ @build_number = params[:build_number]
14
+ @description = params[:description]
15
+
16
+ url = "#{base_uri}/submitDescription"
17
+ res = if @user
18
+ HTTP.basic_auth(user: @user, pass: @password)
19
+ .post(url, form: {description: @description})
20
+ else
21
+ HTTP.post(url, form: {description: @description})
22
+ end
23
+
24
+ result = res.status == 302 ? true : false
25
+
26
+ params = {
27
+ title: "Summary for update_jenkins_build #{UpdateJenkinsBuild::VERSION}".green,
28
+ rows: {
29
+ result: (result ? 'success' : 'fail'),
30
+ url: "#{base_uri}/editDescription",
31
+ auth: @user ? true : false,
32
+ description: @description,
33
+ }
34
+ }
35
+
36
+ puts ""
37
+ puts Terminal::Table.new(params)
38
+ puts ""
39
+
40
+ result
41
+ end
42
+
43
+ def self.base_uri
44
+ uri = URI(ENV['JENKINS_URL'])
45
+ uri.path = "/job/#{@project}/#{@build_number}"
46
+ uri.to_s
47
+ end
48
+
49
+ def self.return_value
50
+ "ture/false"
51
+ end
52
+
53
+ def self.return_type
54
+ :boolean
55
+ end
56
+
57
+ def self.example_code
58
+ [
59
+ 'update_jenkins_build(
60
+ description: "AdHoc v1.0 (1.0.1)"
61
+ )',
62
+ 'update_jenkins_build(
63
+ project: "foobar", # specify specific project name
64
+ build_number: 75, # specify specific build number
65
+ description: "AdHoc v1.0 (1.0.1)",
66
+ user: "admin",
67
+ password: "123"
68
+ )',
69
+ 'result = update_jenkins_build(
70
+ description: "AdHoc v1.0 (1.0.1)"
71
+ )'
72
+ ]
73
+ end
74
+
75
+ def self.description
76
+ "Update build's description of jenkins"
77
+ end
78
+
79
+ def self.available_options
80
+ [
81
+ FastlaneCore::ConfigItem.new(key: :description,
82
+ env_name: "UPDATE_JENKINS_BUILD_DESCRIPTION",
83
+ description: "the description of current build",
84
+ optional: false,
85
+ type: String),
86
+ FastlaneCore::ConfigItem.new(key: :project,
87
+ env_name: "UPDATE_JENKINS_BUILD_PROJECT",
88
+ description: "the name of project(job)",
89
+ default_value: ENV["JOB_NAME"],
90
+ optional: true,
91
+ type: String),
92
+ FastlaneCore::ConfigItem.new(key: :build_number,
93
+ env_name: "UPDATE_JENKINS_BUILD_BUILD_NUMBER",
94
+ description: "the build number of project(job)",
95
+ default_value: ENV["BUILD_NUMBER"],
96
+ optional: true,
97
+ type: Integer),
98
+ FastlaneCore::ConfigItem.new(key: :user,
99
+ env_name: "UPDATE_JENKINS_BUILD_USER",
100
+ description: "the user of jenkins if enabled security",
101
+ default_value: ENV["CICL_CHANGELOG_JENKINS_USER"],
102
+ optional: true,
103
+ type: String),
104
+ FastlaneCore::ConfigItem.new(key: :password,
105
+ env_name: "UPDATE_JENKINS_BUILD_PASSWORD",
106
+ description: "the password of jenkins if enabled security",
107
+ default_value: ENV["CICL_CHANGELOG_JENKINS_TOKEN"],
108
+ optional: true,
109
+ type: String),
110
+ ]
111
+ end
112
+
113
+ def self.authors
114
+ ["icyleaf"]
115
+ end
116
+
117
+ def self.is_supported?(platform)
118
+ true
119
+ end
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,16 @@
1
+ require 'fastlane_core/ui/ui'
2
+
3
+ module Fastlane
4
+ UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
5
+
6
+ module Helper
7
+ class UpdateJenkinsBuildHelper
8
+ # class methods that you define here become available in your action
9
+ # as `Helper::UpdateJenkinsBuildHelper.your_method`
10
+ #
11
+ def self.show_message
12
+ UI.message("Hello from the update_jenkins_build plugin helper!")
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module UpdateJenkinsBuild
3
+ VERSION = "0.1.4"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,203 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-update_jenkins_build
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.4
5
+ platform: ruby
6
+ authors:
7
+ - icyleaf
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-01-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: http
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.2.2
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.2.2
27
+ - !ruby/object:Gem::Dependency
28
+ name: pry
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec_junit_formatter
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
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'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 0.49.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 0.49.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-require_tools
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: simplecov
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: fastlane
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: 2.78.0
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: 2.78.0
153
+ - !ruby/object:Gem::Dependency
154
+ name: webmock
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description:
168
+ email: icyleaf.cn@gmail.com
169
+ executables: []
170
+ extensions: []
171
+ extra_rdoc_files: []
172
+ files:
173
+ - LICENSE
174
+ - README.md
175
+ - lib/fastlane/plugin/update_jenkins_build.rb
176
+ - lib/fastlane/plugin/update_jenkins_build/actions/update_jenkins_build_action.rb
177
+ - lib/fastlane/plugin/update_jenkins_build/helper/update_jenkins_build_helper.rb
178
+ - lib/fastlane/plugin/update_jenkins_build/version.rb
179
+ homepage: https://github.com/icyleaf/fastlane-plugin-update_jenkins_build
180
+ licenses:
181
+ - MIT
182
+ metadata: {}
183
+ post_install_message:
184
+ rdoc_options: []
185
+ require_paths:
186
+ - lib
187
+ required_ruby_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ required_rubygems_version: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: '0'
197
+ requirements: []
198
+ rubyforge_project:
199
+ rubygems_version: 2.6.12
200
+ signing_key:
201
+ specification_version: 4
202
+ summary: Update Description of Build
203
+ test_files: []