fastlane-plugin-elux_actions 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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 91f5b5a0171a995e3b1170d704426cf834a83fd7
|
4
|
+
data.tar.gz: 7844ff12283507712ab47308a65e75f8abb4053e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 731241fc5f21b562b6acebccc9985927969c3e9c7704c79d7b653b3b4806e850717ef40d3faf6ac57dfe50d28a4d23b074d64ce645af4889371d30de10400e56
|
7
|
+
data.tar.gz: 83f0d1f30c8955ecf92e7fe918ab64d655ce762374972cd1350324caebe019805077aed00a00c4206b450582762c0bb6b6157ff8c939bf666f9cbc8de4ff41bd
|
@@ -0,0 +1,152 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
RELEASE_TO_NEXUS_CUSTOM_VALUE = :RELEASE_TO_NEXUS_CUSTOM_VALUE
|
5
|
+
end
|
6
|
+
|
7
|
+
class UploadToNexus3Action < Action
|
8
|
+
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]}"
|
33
|
+
end
|
34
|
+
|
35
|
+
#####################################################
|
36
|
+
# @!group Documentation
|
37
|
+
#####################################################
|
38
|
+
|
39
|
+
def self.description
|
40
|
+
"Uploads an artifact to Nexus 3"
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.details
|
44
|
+
# Optional:
|
45
|
+
# this is your chance to provide a more detailed description of this action
|
46
|
+
"You can use this action to do cool things..."
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.available_options
|
50
|
+
# Define all options your action supports.
|
51
|
+
|
52
|
+
# Below a few examples
|
53
|
+
[
|
54
|
+
FastlaneCore::ConfigItem.new(key: :file,
|
55
|
+
env_name: "file", # The name of the repository
|
56
|
+
description: "File to upload", # a short description of this parameter
|
57
|
+
verify_block: proc do |value|
|
58
|
+
UI.user_error!("Please provide file") unless value and !value.empty?
|
59
|
+
end),
|
60
|
+
FastlaneCore::ConfigItem.new(key: :repository,
|
61
|
+
env_name: "repository", # The name of the repository
|
62
|
+
description: "Target repository", # a short description of this parameter
|
63
|
+
verify_block: proc do |value|
|
64
|
+
UI.user_error!("Please provide repository") unless value and !value.empty?
|
65
|
+
end),
|
66
|
+
FastlaneCore::ConfigItem.new(key: :nexus_base_url,
|
67
|
+
env_name: "nexus_base_url", # The name of the environment variable
|
68
|
+
description: "The URL base address to nexus. Example https://localhost:8080", # a short description of this parameter
|
69
|
+
verify_block: proc do |value|
|
70
|
+
UI.user_error!("Please provide nexus_base_url") unless value and !value.empty?
|
71
|
+
# UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
|
72
|
+
end),
|
73
|
+
FastlaneCore::ConfigItem.new(key: :artifact_id,
|
74
|
+
env_name: "artifact_id", # The name of the environment variable
|
75
|
+
description: "The artifact_id to use", # a short description of this parameter
|
76
|
+
verify_block: proc do |value|
|
77
|
+
UI.user_error!("Please provide artifact_id") unless value and !value.empty?
|
78
|
+
# UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
|
79
|
+
end),
|
80
|
+
FastlaneCore::ConfigItem.new(key: :group_id,
|
81
|
+
env_name: "group_id",
|
82
|
+
description: "The group_id to use",
|
83
|
+
verify_block: proc do |value|
|
84
|
+
UI.user_error!("Please provide group_id") unless value and !value.empty?
|
85
|
+
# UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
|
86
|
+
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),
|
99
|
+
FastlaneCore::ConfigItem.new(key: :classifier,
|
100
|
+
env_name: "classifier",
|
101
|
+
description: "The classifier of the artifact",
|
102
|
+
default_value: "",
|
103
|
+
optional: true),
|
104
|
+
FastlaneCore::ConfigItem.new(key: :nexus_user,
|
105
|
+
env_name: "nexus_user",
|
106
|
+
description: "The username in nexus",
|
107
|
+
verify_block: proc do |value|
|
108
|
+
UI.user_error!("Please provide group_id") unless value and !value.empty?
|
109
|
+
# UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
|
110
|
+
end),
|
111
|
+
FastlaneCore::ConfigItem.new(key: :nexus_password,
|
112
|
+
env_name: "nexus_password",
|
113
|
+
description: "The password in nexus",
|
114
|
+
verify_block: proc do |value|
|
115
|
+
UI.user_error!("Please provide group_id") unless value and !value.empty?
|
116
|
+
# UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
|
117
|
+
end)
|
118
|
+
]
|
119
|
+
end
|
120
|
+
|
121
|
+
def self.output
|
122
|
+
# Define the shared values you are going to provide
|
123
|
+
# Example
|
124
|
+
[
|
125
|
+
['UPLOAD_TO_NEXUS_3_CUSTOM_VALUE', 'A description of what this value contains']
|
126
|
+
]
|
127
|
+
end
|
128
|
+
|
129
|
+
def self.return_value
|
130
|
+
# If you method provides a return value, you can describe here what it does
|
131
|
+
end
|
132
|
+
|
133
|
+
def self.authors
|
134
|
+
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
|
135
|
+
["Your GitHub/Twitter Name"]
|
136
|
+
end
|
137
|
+
|
138
|
+
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
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-elux_actions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Granath
|
@@ -104,6 +104,7 @@ files:
|
|
104
104
|
- README.md
|
105
105
|
- lib/fastlane/plugin/elux_actions.rb
|
106
106
|
- lib/fastlane/plugin/elux_actions/actions/nexus_promote_action.rb
|
107
|
+
- lib/fastlane/plugin/elux_actions/actions/upload_to_nexus_3.rb
|
107
108
|
- lib/fastlane/plugin/elux_actions/helper/elux_actions_helper.rb
|
108
109
|
- lib/fastlane/plugin/elux_actions/version.rb
|
109
110
|
homepage:
|