fastlane-plugin-nexus_raw_upload 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1a3b7a407759bce7cdada424d2f9848d0ccef40c46cbf0947ebb81782d46c989
4
+ data.tar.gz: ee88440f48e0f4790197e6329e4c0e3090fd01502a470810d38200dcce1b2db6
5
+ SHA512:
6
+ metadata.gz: 26da8833d1a830a5351c788d9d2c7fc6bb334e9c68bd0db3e8affd65a7008193133e72064a06f851b9febb6bdd0f92de75d66e35058d0791ba627e32aed87c6e
7
+ data.tar.gz: 03b43509a0b615e572e70655df2ff32ba97eb3b17b854023a5a96331456fe63fe11003ab55b0a1b2ab6228680126f8e0157c476a740f7a0feb1d9a0053f50668
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Thang Nguyen Cao <thangnc@tech.est-rouge.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.
data/README.md ADDED
@@ -0,0 +1,84 @@
1
+ # nexus_raw_upload plugin
2
+
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-nexus_raw_upload) ![Gem Version](https://badge.fury.io/rb/fastlane-plugin-nexus_raw_upload.svg) ![](https://ruby-gem-downloads-badge.herokuapp.com/fastlane-plugin-nexus_raw_upload) [![CircleCI](https://circleci.com/gh/thangnc/fastlane-plugin-nexus_raw_upload.svg?style=shield)](https://circleci.com/gh/thangnc/fastlane-plugin-nexus_raw_upload)
4
+
5
+ ## Getting Started
6
+
7
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started
8
+ with `fastlane-plugin-nexus_raw_upload`, add it to your project by running:
9
+
10
+ ```bash
11
+ fastlane add_plugin nexus_raw_upload
12
+ ```
13
+
14
+ ## About nexus_raw_upload
15
+
16
+ Actions related to Nexus raw upload
17
+
18
+ ### raw_upload
19
+
20
+ | Key | Description | Env Var | Default |
21
+ |---------------|----------------------------------------------------------------------------------------------------------------------------------|---------|---------|
22
+ | file | File to be uploaded to Nexus | | |
23
+ | repository | Nexus repository id e.g. artifacts | | |
24
+ | raw_directory | Nexus raw directory name e.g. 'com/fastlane'. Only letters, digits, underscores(_), hyphens(-), and forward slash(/) are allowed | | |
25
+ | file_name | Nexus asset file name | | |
26
+ | endpoint | Nexus endpoint e.g. http://nexus:8081 | | |
27
+ | username | Nexus username | | |
28
+ | password | Nexus password | | |
29
+ | ssl_verify | Verify SSL | | true |
30
+ | verbose | Make detailed output | | false |
31
+
32
+ ```ruby
33
+ raw_upload(
34
+ file: "/path/to/file.ipa",
35
+ repository: "artifacts",
36
+ raw_directory: "com/fastlane",
37
+ file_name: "myproject",
38
+ endpoint: "http://localhost:8081",
39
+ username: "admin",
40
+ password: "admin123"
41
+ )
42
+ ```
43
+
44
+ ## Example
45
+
46
+ Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo,
47
+ running `fastlane install_plugins` and `bundle exec fastlane test`.
48
+
49
+ **Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide
50
+ everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if
51
+ necessary)
52
+
53
+ ## Run tests for this plugin
54
+
55
+ To run both the tests, and code style validation, run
56
+
57
+ ```
58
+ rake
59
+ ```
60
+
61
+ To automatically fix many of the styling issues, use
62
+
63
+ ```
64
+ rubocop -a
65
+ ```
66
+
67
+ ## Issues and Feedback
68
+
69
+ For any other issues and feedback about this plugin, please submit it to this repository.
70
+
71
+ ## Troubleshooting
72
+
73
+ If you have trouble using plugins, check out
74
+ the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
75
+
76
+ ## Using _fastlane_ Plugins
77
+
78
+ For more information about how the `fastlane` plugin system works, check out
79
+ the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
80
+
81
+ ## About _fastlane_
82
+
83
+ _fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more,
84
+ check out [fastlane.tools](https://fastlane.tools).
@@ -0,0 +1,118 @@
1
+ require 'fastlane/action'
2
+ require 'fastlane_core/configuration/config_item'
3
+ require_relative '../helper/nexus_raw_upload_helper'
4
+
5
+ module Fastlane
6
+ module Actions
7
+ class RawUploadAction < Action
8
+ def self.run(params)
9
+ command = []
10
+ command << "curl"
11
+ command << verbose(params)
12
+ command << "--fail"
13
+ command += ssl_options(params)
14
+ command += upload_options(params)
15
+ command << upload_url(params)
16
+ end
17
+
18
+ def self.description
19
+ "Upload a raw asset to [Sonatype Nexus platform](https://www.sonatype.com)"
20
+ end
21
+
22
+ def self.authors
23
+ ["Thang Nguyen Cao"]
24
+ end
25
+
26
+ def self.return_value
27
+ # If your method provides a return value, you can describe here what it does
28
+ end
29
+
30
+ def self.details
31
+ # Optional:
32
+ ""
33
+ end
34
+
35
+ def self.available_options
36
+ [
37
+ FastlaneCore::ConfigItem.new(key: :file,
38
+ description: "File to be uploaded to Nexus",
39
+ optional: false,
40
+ verify_block: proc do |value|
41
+ file_path = File.expand_path(value)
42
+ UI.user_error!("Couldn't find file at path '#{file_path}'") unless File.exist?(file_path)
43
+ end),
44
+ FastlaneCore::ConfigItem.new(key: :repository,
45
+ description: "Nexus repository e.g. cdn-releases",
46
+ optional: false),
47
+ FastlaneCore::ConfigItem.new(key: :raw_directory,
48
+ description: "Nexus raw directory e.g. artifacts",
49
+ optional: false),
50
+ FastlaneCore::ConfigItem.new(key: :file_name,
51
+ description: "Nexus file name",
52
+ optional: false),
53
+ FastlaneCore::ConfigItem.new(key: :endpoint,
54
+ description: "Nexus endpoint e.g. http://nexus:8081",
55
+ optional: false),
56
+ FastlaneCore::ConfigItem.new(key: :username,
57
+ description: "Nexus username",
58
+ optional: false),
59
+ FastlaneCore::ConfigItem.new(key: :password,
60
+ description: "Nexus password",
61
+ optional: false),
62
+ FastlaneCore::ConfigItem.new(key: :ssl_verify,
63
+ description: "Verify SSL",
64
+ type: Boolean,
65
+ default_value: true,
66
+ optional: true),
67
+ FastlaneCore::ConfigItem.new(key: :verbose,
68
+ description: "Make detailed output",
69
+ type: Boolean,
70
+ default_value: false,
71
+ optional: true)
72
+ ]
73
+ end
74
+
75
+ def self.is_supported?(platform)
76
+ # Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
77
+ # See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
78
+ #
79
+ # [:ios, :mac, :android].include?(platform)
80
+ true
81
+ end
82
+
83
+ def self.verbose(params)
84
+ params[:verbose] ? "--verbose" : "--silent"
85
+ end
86
+
87
+ def self.ssl_options(params)
88
+ options = []
89
+ unless params[:ssl_verify]
90
+ options << "--insecure"
91
+ end
92
+
93
+ options
94
+ end
95
+
96
+ def self.upload_options(params)
97
+ file_path = File.expand_path(params[:file]).shellescape
98
+
99
+ options = []
100
+ options << "--upload-file #{file_path}"
101
+ options << "-u #{params[:username].shellescape}:#{params[:password].shellescape}"
102
+
103
+ options
104
+ end
105
+
106
+ def self.upload_url(params)
107
+ file_extension = File.extname(params[:file]).shellescape
108
+
109
+ url = (params[:endpoint]).to_s
110
+ url << "/repository/#{params[:repository]}"
111
+ url << "/#{params[:raw_directory]}"
112
+ url << "/#{params[:file_name]}"
113
+ url << file_extension.to_s
114
+ url.shellescape
115
+ end
116
+ end
117
+ end
118
+ 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 NexusBlobUploadHelper
8
+ # class methods that you define here become available in your action
9
+ # as `Helper::NexusBlobUploadHelper.your_method`
10
+ #
11
+ def self.show_message
12
+ UI.message("Hello from the nexus_raw_upload plugin helper!")
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module NexusRawUpload
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/nexus_raw_upload/version'
2
+
3
+ module Fastlane
4
+ module NexusRawUpload
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::NexusRawUpload.all_classes.each do |current|
15
+ require current
16
+ end
metadata ADDED
@@ -0,0 +1,189 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-nexus_raw_upload
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Thang Nguyen
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-06-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: fastlane
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 2.206.2
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 2.206.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
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: rake
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
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: rspec_junit_formatter
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: 1.30.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 1.30.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-performance
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: rubocop-require_tools
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: simplecov
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ description:
154
+ email: thang.nguyencao@gmail.com
155
+ executables: []
156
+ extensions: []
157
+ extra_rdoc_files: []
158
+ files:
159
+ - LICENSE
160
+ - README.md
161
+ - lib/fastlane/plugin/nexus_raw_upload.rb
162
+ - lib/fastlane/plugin/nexus_raw_upload/actions/raw_upload_action.rb
163
+ - lib/fastlane/plugin/nexus_raw_upload/helper/nexus_raw_upload_helper.rb
164
+ - lib/fastlane/plugin/nexus_raw_upload/version.rb
165
+ homepage: https://github.com/thangnc/fastlane-plugin-nexus_raw_upload
166
+ licenses:
167
+ - MIT
168
+ metadata:
169
+ rubygems_mfa_required: 'true'
170
+ post_install_message:
171
+ rdoc_options: []
172
+ require_paths:
173
+ - lib
174
+ required_ruby_version: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '2.6'
179
+ required_rubygems_version: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - ">="
182
+ - !ruby/object:Gem::Version
183
+ version: '0'
184
+ requirements: []
185
+ rubygems_version: 3.0.3.1
186
+ signing_key:
187
+ specification_version: 4
188
+ summary: Actions related to Nexus blob upload
189
+ test_files: []