fastlane-plugin-elux_actions 1.2.2 → 1.2.3

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: 8b2bea27f6c1e25ec9ccb70fedb0dcbc0f53628c
4
- data.tar.gz: 9c15e99a336b5abde2fab97c1f962b14a97120ea
3
+ metadata.gz: 10d100d0c6f3423c3038b4487f9305c8a7abd1a7
4
+ data.tar.gz: 7e5f8ca6d75c6a32266176b57ba8adc769f87b81
5
5
  SHA512:
6
- metadata.gz: 9185a8c5be65a58a4c12b293f76b15adae16f7668b33c8827a87904e4b4ea6f67e3bc04a57dcf6d65ddc9f9366fa72bca86639d943f32bef506db8abddebfb65
7
- data.tar.gz: 4bb251810d5c8a927a1e7f76037174ec0ede8029147298479d467a58f287dc8a1988996efd61eb905eeccd6730fea518d89a0d56385fd44fe21ed0d5c481bdf4
6
+ metadata.gz: 9d8318d85ea71297085c8caa62197e79bdcc6837f70414fe06cdba90fd5660469a80ecf693b8142a0f983b1a31048059b797fb87036e0ba43d863a23ee7d9f15
7
+ data.tar.gz: 6137688a25e23c1238030b25621481daa85c463ce63faf3bfaa283279f8d33181732d5d93b3a27fe0a64c845b936fbb05d39a5cfce1007c2a8369100ace6b367
@@ -14,14 +14,11 @@ module Fastlane
14
14
  version = `#{cmd}`
15
15
  Actions.lane_context[SharedValues::NEW_VERSION] = version
16
16
  Actions.lane_context[SharedValues::NEW_VERSION_NUMBERS] = version.gsub(/[a-zA-Z]/, '')
17
- version
18
17
 
19
18
  # Create the tag
20
19
  cmd = "git tag -a \"#{version}\" -m \"Version #{version}\""
21
20
  STDOUT.puts cmd
22
21
  STDOUT.flush
23
- status = sh cmd
24
-
25
22
  end
26
23
 
27
24
  #####################################################
@@ -1,35 +1,24 @@
1
1
  module Fastlane
2
2
  module Actions
3
- module SharedValues
4
- RELEASE_TO_NEXUS_CUSTOM_VALUE = :RELEASE_TO_NEXUS_CUSTOM_VALUE
5
- end
6
-
7
3
  class UploadToNexus3Action < Action
8
4
  def self.run(params)
9
- # fastlane will take care of reading in the parameter and fetching the environment variable:
10
-
11
- classifier_str = "-#{params[:classifier]}" unless params[:classifier].empty?
12
-
13
- path = params[:group_id].gsub(".", "/")
14
-
15
- pom = [
16
- "<project>",
17
- " <modelVersion>4.0.0</modelVersion>",
18
- " <groupId>#{params[:group_id]}</groupId>",
19
- " <artifactId>#{params[:artifact_id]}</artifactId>",
20
- " <version>#{params[:version]}</version>",
21
- "</project>"
22
- ].join("\n")
23
- STDOUT.puts pom
24
- STDOUT.flush
25
-
26
- pomFile = Tempfile.new("pom.xml")
27
- pomFile.write(pom)
28
- pomFile.flush
29
-
30
-
31
- sh "curl -v -u \"" + params[:nexus_user] + ":" + params[:nexus_password] + "\" --upload-file #{pomFile.path} #{params[:nexus_base_url]}/repository/#{params[:repository]}/#{path}/#{params[:artifact_id]}/#{params[:version]}/#{params[:artifact_id]}-#{params[:version]}#{classifier_str}.pom"
32
- sh "curl -v -u \"" + params[:nexus_user] + ":" + params[:nexus_password] + "\" --upload-file #{params[:file]} #{params[:nexus_base_url]}/repository/#{params[:repository]}/#{path}/#{params[:artifact_id]}/#{params[:version]}/#{params[:artifact_id]}-#{params[:version]}#{classifier_str}.#{params[:type]}"
5
+ @group_id = params[:group_id]
6
+ @artifact_id = params[:artifact_id]
7
+ @version = params[:version]
8
+ @classifier = params[:classifier]
9
+ @nexus_base_url = params[:nexus_base_url]
10
+ @nexus_user = params[:nexus_user]
11
+ @repository = params[:repository]
12
+ @type = params[:type]
13
+
14
+ ENV['FASTLANE_NEXUS_PASSWORD'] = params[:nexus_password]
15
+
16
+ actions = [
17
+ "curl --fail -u \"#{credentials}\" --upload-file #{temp_pom_file} #{pom_url} #{verbose}",
18
+ "curl --fail -u \"#{credentials}\" --upload-file #{params[:file]} #{file_url} #{verbose}"
19
+ ].map(&:rstrip).join(' && ')
20
+
21
+ sh(actions)
33
22
  end
34
23
 
35
24
  #####################################################
@@ -84,18 +73,18 @@ module Fastlane
84
73
  UI.user_error!("Please provide group_id") unless value and !value.empty?
85
74
  # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
86
75
  end),
87
- FastlaneCore::ConfigItem.new(key: :type,
88
- env_name: "type",
89
- description: "The artefact types",
90
- is_string: false,
91
- default_value: ""),
92
- FastlaneCore::ConfigItem.new(key: :version,
93
- env_name: "version",
94
- description: "The version of the artifact",
95
- verify_block: proc do |value|
96
- UI.user_error!("Please provide version") unless value and !value.empty?
97
- # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
98
- end),
76
+ FastlaneCore::ConfigItem.new(key: :type,
77
+ env_name: "type",
78
+ description: "The artefact types",
79
+ is_string: false,
80
+ default_value: ""),
81
+ FastlaneCore::ConfigItem.new(key: :version,
82
+ env_name: "version",
83
+ description: "The version of the artifact",
84
+ verify_block: proc do |value|
85
+ UI.user_error!("Please provide version") unless value and !value.empty?
86
+ # UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
87
+ end),
99
88
  FastlaneCore::ConfigItem.new(key: :classifier,
100
89
  env_name: "classifier",
101
90
  description: "The classifier of the artifact",
@@ -136,16 +125,68 @@ module Fastlane
136
125
  end
137
126
 
138
127
  def self.is_supported?(platform)
139
- # you can do things like
140
- #
141
- # true
142
- #
143
- # platform == :ios
144
- #
145
- # [:ios, :mac].include?(platform)
146
- #
147
-
148
- platform == :ios
128
+ platform == :android
129
+ end
130
+
131
+ class << self
132
+ def verbose
133
+ "-v" if FastlaneCore::Globals.verbose?
134
+ end
135
+
136
+ def temp_pom_file
137
+ pom = [
138
+ "<project>",
139
+ " <modelVersion>4.0.0</modelVersion>",
140
+ " <groupId>#{@group_id}</groupId>",
141
+ " <artifactId>#{@artifact_id}</artifactId>",
142
+ " <version>#{@version}</version>",
143
+ classifier_tag,
144
+ "</project>"
145
+ ].compact.join("\n")
146
+
147
+ pom_file = Tempfile.new("pom.xml")
148
+ pom_file.write(pom)
149
+ pom_file.flush
150
+
151
+ return pom_file.path
152
+ end
153
+
154
+ def group_path
155
+ @group_id.gsub(".", "/")
156
+ end
157
+
158
+ def artifact_url
159
+ [
160
+ @nexus_base_url,
161
+ "repository",
162
+ @repository,
163
+ group_path,
164
+ @artifact_id,
165
+ @version
166
+ ].join("/")
167
+ end
168
+
169
+ def classifier
170
+ "-#{@classifier}" unless @classifier.empty?
171
+ end
172
+
173
+ def classifier_tag
174
+ " <classifier>#{@classifier}</classifier>" unless @classifier.empty?
175
+ end
176
+
177
+ def file_url
178
+ file_name = "#{@artifact_id}-#{@version}#{classifier}.#{@type}"
179
+ [artifact_url, file_name].join("/")
180
+ end
181
+
182
+ def pom_url
183
+ pom_name = "#{@artifact_id}-#{@version}#{classifier}.pom"
184
+ [artifact_url, pom_name].join("/")
185
+ end
186
+
187
+ def credentials
188
+ "#{@nexus_user}:$FASTLANE_NEXUS_PASSWORD"
189
+ end
149
190
  end
150
191
  end
151
192
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module EluxActions
3
- VERSION = "1.2.2"
3
+ VERSION = "1.2.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-elux_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Granath
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-04 00:00:00.000000000 Z
11
+ date: 2017-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: pry
14
+ name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -25,21 +25,21 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: fastlane
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: 2.28.4
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: 2.28.4
41
41
  - !ruby/object:Gem::Dependency
42
- name: rspec
42
+ name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rubocop
70
+ name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,19 +81,19 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: fastlane
84
+ name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 2.28.4
89
+ version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 2.28.4
96
+ version: '0'
97
97
  description:
98
98
  email: dennis@diabol.se
99
99
  executables: []
@@ -105,7 +105,7 @@ files:
105
105
  - lib/fastlane/plugin/elux_actions.rb
106
106
  - lib/fastlane/plugin/elux_actions/actions/increment_version_and_tag.rb
107
107
  - lib/fastlane/plugin/elux_actions/actions/nexus_promote_action.rb
108
- - lib/fastlane/plugin/elux_actions/actions/upload_to_nexus_3.rb
108
+ - lib/fastlane/plugin/elux_actions/actions/upload_to_nexus_3_action.rb
109
109
  - lib/fastlane/plugin/elux_actions/helper/elux_actions_helper.rb
110
110
  - lib/fastlane/plugin/elux_actions/version.rb
111
111
  homepage:
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubyforge_project:
131
- rubygems_version: 2.6.12
131
+ rubygems_version: 2.6.14
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: Plugin including actions for releasing the android SDK