fastlane-plugin-napp_distribution 1.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6220950ae435f616759ca5d31db5f441b95d51e8
4
+ data.tar.gz: 7ec8529d49c4f4ebb10732502f9d4ace97dc677c
5
+ SHA512:
6
+ metadata.gz: 5b5539d2290df72d3c45b7388605daddcc18484f54d6601f21fa164e743177576984835a3d3ad38ee06375dea9eda9a73a37581cddb10dcf245aa247e103370e
7
+ data.tar.gz: d6d563b064c1dd0659219dc3911cb882392c47f80127ace2d128321848e44e1439af82b1c4660bf8532817b3af74744817f7672210992db435b50da29fff1798
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Mads Møller <mm@napp.dk>
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,41 @@
1
+ # Napp Distribution Plugin
2
+
3
+ [![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-napp_distribution)
4
+
5
+ ## Getting Started
6
+
7
+ This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-napp_distribution`, add it to your project by running:
8
+
9
+ ```bash
10
+ fastlane add_plugin napp_distribution
11
+ ```
12
+
13
+ ## About
14
+
15
+ Upload a new build to Napp Distribution to distribute the build to beta testers. Works for both Ad Hoc and Enterprise signed applications. The `fastlane-plugin-napp_distribution` action can upload both iOS apps (IPAs) and Android apps (APKs).
16
+
17
+ ## Example
18
+
19
+ Use the following snippet in your lane
20
+
21
+ ```bash
22
+ napp_distribution(
23
+ api_key: "my-api-key",
24
+ client_id: "app-name",
25
+ file_path: "path/to/the/app.ipa"
26
+ )
27
+ ```
28
+
29
+ ## Issues and Feedback
30
+
31
+ For any other issues and feedback about this plugin, please submit it to this repository.
32
+
33
+ ## Troubleshooting
34
+
35
+ If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
36
+
37
+
38
+ ## About _fastlane_
39
+
40
+ _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).
41
+
@@ -0,0 +1,16 @@
1
+ require 'fastlane/plugin/napp_distribution/version'
2
+
3
+ module Fastlane
4
+ module NappDistribution
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::NappDistribution.all_classes.each do |current|
15
+ require current
16
+ end
@@ -0,0 +1,110 @@
1
+ module Fastlane
2
+ module Actions
3
+ class NappDistributionAction < Action
4
+ def self.run(params)
5
+ UI.message("The napp_distribution plugin is working!")
6
+
7
+ # set the base url
8
+ base_url = "https://i.napp.dk"
9
+ if params[:base_url]
10
+ base_url = params[:base_url]
11
+ end
12
+
13
+ file_path = params[:file_path]
14
+ client_id = params[:client_id]
15
+ api_key = params[:api_key]
16
+
17
+ connection = self.connection(base_url)
18
+
19
+ if !File.exist?(file_path)
20
+ UI.user_error("App build file not found 🚫")
21
+ abort
22
+ end
23
+
24
+ # setting the payload
25
+ payload = {}
26
+ payload[:file] = Faraday::UploadIO.new(file_path, 'application/octet-stream')
27
+ payload[:client] = client_id
28
+
29
+ response = connection.post do |req|
30
+ req.url("/api/clients/upload")
31
+ req.headers['X-NAPP-API-KEY'] = api_key
32
+ req.body = payload
33
+ end
34
+
35
+ case response.status
36
+ when 200...300
37
+ app_version_id = response.body['version']
38
+ platform = response.body['platform']
39
+ UI.message("Successfully created new app build version: #{app_version_id} for #{platform}")
40
+ else
41
+ UI.user_error!("Error trying to upload new app build: #{response.status} - #{response.body}")
42
+ end
43
+
44
+ end
45
+
46
+ #
47
+ def self.connection(base_url)
48
+ require 'faraday'
49
+ require 'faraday_middleware'
50
+
51
+ foptions = {
52
+ url: base_url
53
+ }
54
+ Faraday.new(foptions) do |builder|
55
+ builder.request :multipart
56
+ builder.request :url_encoded
57
+ builder.response :json, content_type: /\bjson$/
58
+ builder.use FaradayMiddleware::FollowRedirects
59
+ builder.adapter :net_http
60
+ end
61
+ end
62
+
63
+ def self.description
64
+ "Upload builds to Napp Distribution Center"
65
+ end
66
+
67
+ def self.authors
68
+ ["Mads Møller"]
69
+ end
70
+
71
+ def self.return_value
72
+ # If your method provides a return value, you can describe here what it does
73
+ end
74
+
75
+ def self.details
76
+ # Optional:
77
+ "Upload builds to Napp Distribution Center"
78
+ end
79
+
80
+ def self.available_options
81
+ [
82
+ FastlaneCore::ConfigItem.new(key: :api_key,
83
+ env_name: "NAPP_DISTRIBUTION_API_KEY",
84
+ description: "API Key",
85
+ optional: false,
86
+ type: String),
87
+ FastlaneCore::ConfigItem.new(key: :client_id,
88
+ env_name: "NAPP_DISTRIBUTION_CLIENT_ID",
89
+ optional: false,
90
+ description: "Client name",
91
+ type: String),
92
+ FastlaneCore::ConfigItem.new(key: :file_path,
93
+ env_name: "NAPP_DISTRIBUTION_FILE_PATH",
94
+ optional: false,
95
+ description: "File path of the app build",
96
+ type: String),
97
+ FastlaneCore::ConfigItem.new(key: :base_url,
98
+ env_name: "NAPP_DISTRIBUTION_BASE_URL",
99
+ optional: true,
100
+ type: String,
101
+ description: "Private cloud option")
102
+ ]
103
+ end
104
+
105
+ def self.is_supported?(platform)
106
+ [:ios, :android].include?(platform)
107
+ end
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,12 @@
1
+ module Fastlane
2
+ module Helper
3
+ class NappDistributionHelper
4
+ # class methods that you define here become available in your action
5
+ # as `Helper::NappDistributionHelper.your_method`
6
+ #
7
+ def self.show_message
8
+ UI.message("Hello from the napp_distribution plugin helper!")
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module NappDistribution
3
+ VERSION = "1.0.0"
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,133 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fastlane-plugin-napp_distribution
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Mads Møller
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-04-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: pry
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: bundler
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: rspec
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: rubocop
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: fastlane
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 2.27.0
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 2.27.0
97
+ description:
98
+ email: mm@napp.dk
99
+ executables: []
100
+ extensions: []
101
+ extra_rdoc_files: []
102
+ files:
103
+ - LICENSE
104
+ - README.md
105
+ - lib/fastlane/plugin/napp_distribution.rb
106
+ - lib/fastlane/plugin/napp_distribution/actions/napp_distribution_action.rb
107
+ - lib/fastlane/plugin/napp_distribution/helper/napp_distribution_helper.rb
108
+ - lib/fastlane/plugin/napp_distribution/version.rb
109
+ homepage: https://github.com/Napp/fastlane-plugin-napp-distribution
110
+ licenses:
111
+ - MIT
112
+ metadata: {}
113
+ post_install_message:
114
+ rdoc_options: []
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: '0'
127
+ requirements: []
128
+ rubyforge_project:
129
+ rubygems_version: 2.6.8
130
+ signing_key:
131
+ specification_version: 4
132
+ summary: Upload IPA AND APK builds to Napp Distribution
133
+ test_files: []