fastlane-plugin-appcircle_enterprise_store 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +83 -0
- data/images/PAT.png +0 -0
- data/images/ent_app_store.png +0 -0
- data/images/extension-icon.png +0 -0
- data/lib/fastlane/plugin/appcircle_enterprise_store/actions/appcircle_enterprise_store_action.rb +183 -0
- data/lib/fastlane/plugin/appcircle_enterprise_store/helper/appcircle_enterprise_store_helper.rb +16 -0
- data/lib/fastlane/plugin/appcircle_enterprise_store/version.rb +5 -0
- data/lib/fastlane/plugin/appcircle_enterprise_store.rb +16 -0
- metadata +52 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 075ced39b68b62e2bf04be9b21a0eaf7e71f25e49f3a970bebd6f66502c22b9a
|
4
|
+
data.tar.gz: cef7596b841fad895e934718a2bb12ad5d3d98dc388161167d9624e40802b3fe
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6c3ca01ebc8f46a7ec418cf436e28acbd416107815b8975e10fedfd7cd5abfd9c6bb88901d7ef4a77cdeff6d51709b3657bd95ae58046979bb9c02d8e0c17d7f
|
7
|
+
data.tar.gz: 4462a8d0a2d5bdbee30cd9bea98b70deb6e658e20b398a7e4ae0bc600696b223a953beb1e7dd355d534046c9cfeede0becab6ec75f0050fff93644b51e2baa39
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 Guven Karanfil <guven.karanfil@smartface.io>
|
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,83 @@
|
|
1
|
+
## Appcircle Enterprise App Store
|
2
|
+
|
3
|
+
[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-appcircle_enterprise_store)
|
4
|
+
|
5
|
+
Appcircle Enterprise Mobile App Store is your own mobile app store for providing access to in-house apps with a customizable mobile storefront.
|
6
|
+
|
7
|
+
- **Customizable Storefront:** Distribute your in-house apps with a fully customizable mobile storefront.
|
8
|
+
- **Secure Distribution:** Everything you need for secure, streamlined distribution of your in-house apps.
|
9
|
+
- **No MDM Required:** Allows distribution of B2B and B2E applications without the need for an MDM solution and enrollment.
|
10
|
+
|
11
|
+
Learn more about [Appcircle Enterprise App Store](https://appcircle.io/enterprise-app-store).
|
12
|
+
|
13
|
+
## What Sets Apart Appcircle Enterprise Mobile App Store
|
14
|
+
|
15
|
+
1. **Direct File Sharing:**
|
16
|
+
- **Skip Traditional Stores:** Share .IPA, APK, or AAB files directly, avoiding the need to wait for Apple App Store or Google Play approvals.
|
17
|
+
2. **Flexible Sharing Options:**
|
18
|
+
- **Beta and Live Modes:** Share your app in ‘beta’ mode for testing new features or identifying bugs, or in ‘live’ mode for stable versions. This flexibility helps maintain the development lifecycle without interruptions.
|
19
|
+
3. **Enhanced Security:**
|
20
|
+
- **Secure Authentication:** Access the Enterprise Mobile App Store with extra secure authentication using Enterprise Authentication Methods.
|
21
|
+
- **Controlled Access:** Ensure that only authorized users can access the app store and its contents.
|
22
|
+
4. **Customizable Mobile Storefront:**
|
23
|
+
- **Tailored Experience:** Provide a customizable mobile storefront for your in-house apps, ensuring a tailored experience that aligns with your brand and user needs.
|
24
|
+
5. **No MDM Requirement:**
|
25
|
+
- **Simplified Distribution:** Distribute B2B and B2E applications without the need for a Mobile Device Management (MDM) solution or enrollment, reducing complexity and costs.
|
26
|
+
6. **Streamlined Workflow:**
|
27
|
+
- **Seamless Integration:** Integrates smoothly with your existing workflow, making it easy to manage and distribute apps within your organization.
|
28
|
+
- **Efficient Management:** Track and manage applications, versions, testers, and teams effectively, ensuring a smooth distribution process.
|
29
|
+
|
30
|
+
These features make the Appcircle Enterprise Mobile App Store a powerful tool for securely and efficiently distributing in-house applications, offering flexibility, enhanced security, and a streamlined workflow.
|
31
|
+
|
32
|
+
![Enterprise App Store Dashboard](images/ent_app_store.png)
|
33
|
+
|
34
|
+
### Generating/Managing the Personal API Tokens
|
35
|
+
|
36
|
+
To generate a Personal API Token:
|
37
|
+
|
38
|
+
1. Go to the My Organization screen (second option at the bottom left).
|
39
|
+
2. Find the Personal API Token section in the top right corner.
|
40
|
+
3. Press the "Generate Token" button to generate your first token.
|
41
|
+
|
42
|
+
![Token Generation](images/PAT.png)
|
43
|
+
|
44
|
+
### Getting Started
|
45
|
+
|
46
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `appcircle_enterprise_store`, add it to your project by running:
|
47
|
+
|
48
|
+
```bash
|
49
|
+
fastlane add_plugin appcircle_enterprise_store
|
50
|
+
```
|
51
|
+
|
52
|
+
After adding the plugin to your project, configure your Fastfile as follows:
|
53
|
+
|
54
|
+
```yml
|
55
|
+
lane :distribute_app_store do
|
56
|
+
appcircle_enterprise_store(
|
57
|
+
accessToken: "$(AC_ACCESS_TOKEN)",
|
58
|
+
entProfileId: "$(ENTERPRISE_PROFILE_ID)",
|
59
|
+
appPath: "$(APP_PATH)",
|
60
|
+
summary: "$(SUMMARY)",
|
61
|
+
releaseNotes: "$(RELEASE_NOTE)",
|
62
|
+
publishType: "$(PUBLISH_TYPE)" # Assign the appropriate number based on the status: None (0), Beta (1), Live (2)
|
63
|
+
)
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
67
|
+
### Leveraging Environment Variables
|
68
|
+
|
69
|
+
Utilize environment variables seamlessly by substituting the parameters with $(VARIABLE_NAME) in your task inputs. The extension automatically retrieves values from the specified environment variables within your pipeline.
|
70
|
+
|
71
|
+
If you would like to learn more about this extension and how to utilize it in your projects, please [contact us](https://appcircle.io/contact)
|
72
|
+
|
73
|
+
## Issues and Feedback
|
74
|
+
|
75
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
76
|
+
|
77
|
+
## Troubleshooting
|
78
|
+
|
79
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
80
|
+
|
81
|
+
### Reference
|
82
|
+
|
83
|
+
For more detailed instructions and support, visit the [Appcircle Enterprise App Store documentation](https://appcircle.io/enterprise-app-store).
|
data/images/PAT.png
ADDED
Binary file
|
Binary file
|
Binary file
|
data/lib/fastlane/plugin/appcircle_enterprise_store/actions/appcircle_enterprise_store_action.rb
ADDED
@@ -0,0 +1,183 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require 'net/http'
|
3
|
+
require 'uri'
|
4
|
+
require 'json'
|
5
|
+
require_relative '../helper/appcircle_enterprise_store_helper'
|
6
|
+
|
7
|
+
module Fastlane
|
8
|
+
module Actions
|
9
|
+
class AppcircleEnterpriseStoreAction < Action
|
10
|
+
def self.run(params)
|
11
|
+
accessToken = params[:accessToken]
|
12
|
+
entProfileId = params[:entProfileId]
|
13
|
+
appPath = params[:appPath]
|
14
|
+
summary = params[:summary]
|
15
|
+
releaseNotes = params[:releaseNotes]
|
16
|
+
publishType = params[:publishType]
|
17
|
+
|
18
|
+
self.ac_login(accessToken)
|
19
|
+
self.uploadToProfile(entProfileId, appPath, summary, releaseNotes, publishType)
|
20
|
+
self.get_version_list(entProfileId)
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.ac_login(accessToken)
|
24
|
+
ac_login = `appcircle login --pat #{accessToken}`
|
25
|
+
if $?.success?
|
26
|
+
UI.success("Logged in to Appcircle successfully.")
|
27
|
+
else
|
28
|
+
raise "Error executing command of logging to Appcircle. Please make sure you have installed Appcircle CLI and provided a valid access token. For more information, please visit https://docs.appcircle.io/appcircle-api/api-authentication#generatingmanaging-the-personal-api-tokens #{ac_login}"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
def self.checkTaskStatus(taskId)
|
34
|
+
uri = URI.parse("https://api.appcircle.io/task/v1/tasks/#{taskId}")
|
35
|
+
timeout = 1
|
36
|
+
jwtToken = `appcircle config get AC_ACCESS_TOKEN -o json`
|
37
|
+
apiAccessToken = JSON.parse(jwtToken)
|
38
|
+
|
39
|
+
response = self.send_request(uri, apiAccessToken["AC_ACCESS_TOKEN"])
|
40
|
+
if response.is_a?(Net::HTTPSuccess)
|
41
|
+
stateValue = JSON.parse(response.body)["stateValue"]
|
42
|
+
|
43
|
+
if stateValue == 1
|
44
|
+
return checkTaskStatus(taskId)
|
45
|
+
else
|
46
|
+
return true
|
47
|
+
end
|
48
|
+
else
|
49
|
+
UI.error("Request failed with response code #{response.code} and message #{response.message}")
|
50
|
+
raise "Request failed"
|
51
|
+
end
|
52
|
+
return false
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
def self.uploadToProfile(entProfileId, appPath, summary, releaseNotes, publishType)
|
57
|
+
# `appcircle enterprise-app-store version upload-for-profile --entProfileId ${profileId} --app ${app}`;
|
58
|
+
ac_upload_profile = `appcircle enterprise-app-store version upload-for-profile --entProfileId #{entProfileId} --app #{appPath} -o json`
|
59
|
+
taskId = JSON.parse(ac_upload_profile)["taskId"]
|
60
|
+
apiAccessTokenString = `appcircle config get AC_ACCESS_TOKEN -o json`
|
61
|
+
apiAccessToken = JSON.parse(apiAccessTokenString)
|
62
|
+
|
63
|
+
if $?.success?
|
64
|
+
result = self.checkTaskStatus(taskId)
|
65
|
+
if result
|
66
|
+
appVersionId = self.get_version_list(entProfileId)
|
67
|
+
self.publishToStore(entProfileId, appVersionId, summary, releaseNotes, publishType)
|
68
|
+
end
|
69
|
+
else
|
70
|
+
raise "Error executing command of uploading the application to the Appcircle Enterprise Store. Please make sure you have provided a valid profile ID and application path.#{ac_upload_profile}"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def self.publishToStore(entProfileId, entVersionId, summary, releaseNote, publishType)
|
75
|
+
# `appcircle enterprise-app-store version publish --entProfileId ${entProfileId} --entVersionId ${entVersionId} --summary "${summary}" --releaseNotes "${releaseNote}" --publishType ${publishType}`;
|
76
|
+
publish_command = `appcircle enterprise-app-store version publish --entProfileId #{entProfileId} --entVersionId #{entVersionId} --summary "#{summary}" --releaseNotes "#{releaseNote}" --publishType #{publishType}`
|
77
|
+
if $?.success?
|
78
|
+
UI.success("Published the application to the Appcircle Enterprise Store successfully\n#{publish_command}")
|
79
|
+
else
|
80
|
+
raise "Error executing command of publishing the application to the Appcircle Enterprise Store. Please make sure you have provided a valid profile ID, version ID, summary, release notes, and publish type. #{publish_command}"
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.send_request(uri, access_token)
|
85
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
86
|
+
http.use_ssl = (uri.scheme == "https")
|
87
|
+
request = Net::HTTP::Get.new(uri.request_uri)
|
88
|
+
request["Authorization"] = "Bearer #{access_token}"
|
89
|
+
http.request(request)
|
90
|
+
end
|
91
|
+
|
92
|
+
def self.get_version_list(entProfileId)
|
93
|
+
store_version_list = `appcircle enterprise-app-store version list --entProfileId #{entProfileId} -o json`;
|
94
|
+
appVersionId = self.getVersionId(store_version_list)
|
95
|
+
UI.message("Uploaded App ID: #{appVersionId}")
|
96
|
+
return appVersionId
|
97
|
+
end
|
98
|
+
|
99
|
+
def self.getVersionId(versions)
|
100
|
+
begin
|
101
|
+
versionList = JSON.parse(versions)
|
102
|
+
|
103
|
+
if versionList.is_a?(Array) && !versionList.empty?
|
104
|
+
return versionList[0]["id"]
|
105
|
+
else
|
106
|
+
return nil
|
107
|
+
end
|
108
|
+
rescue JSON::ParserError => e
|
109
|
+
puts "Failed to parse JSON: #{e.message}"
|
110
|
+
nil
|
111
|
+
rescue => e
|
112
|
+
puts "An error occurred: #{e.message}"
|
113
|
+
nil
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def self.description
|
118
|
+
"Efficiently publish your apps to Appcircle Enterprise Store"
|
119
|
+
end
|
120
|
+
|
121
|
+
def self.authors
|
122
|
+
["Guven Karanfil"]
|
123
|
+
end
|
124
|
+
|
125
|
+
def self.return_value
|
126
|
+
# If your method provides a return value, you can describe here what it does
|
127
|
+
end
|
128
|
+
|
129
|
+
def self.details
|
130
|
+
# Optional:
|
131
|
+
"Appcircle Enterprise Mobile App Store is your own mobile app store for providing access to in-house apps with a customizable mobile storefront"
|
132
|
+
end
|
133
|
+
|
134
|
+
def self.available_options
|
135
|
+
[
|
136
|
+
FastlaneCore::ConfigItem.new(key: :accessToken,
|
137
|
+
env_name: "AC_ACCESS_TOKEN",
|
138
|
+
description: "Provide the Appcircle access token to authenticate connections to Appcircle services. This token allows your Azure DevOps pipeline to interact with Appcircle for distributing applications",
|
139
|
+
optional: false,
|
140
|
+
type: String),
|
141
|
+
|
142
|
+
FastlaneCore::ConfigItem.new(key: :entProfileId,
|
143
|
+
env_name: "AC_ENT_PROFILE_ID",
|
144
|
+
description: "Provide the Appcircle Enterprise App Store Mobile Profile ID to specify the profile to be used for the publishment. This ID can be found in the Enterprise App Store Mobile module dashboard",
|
145
|
+
optional: false,
|
146
|
+
type: String),
|
147
|
+
|
148
|
+
FastlaneCore::ConfigItem.new(key: :appPath,
|
149
|
+
env_name: "AC_APP_PATH",
|
150
|
+
description: "Specify the path to your application file. For iOS, this can be a .ipa or .xcarchive file path. For Android, specify the .apk or .appbundle file path",
|
151
|
+
optional: false,
|
152
|
+
type: String),
|
153
|
+
|
154
|
+
FastlaneCore::ConfigItem.new(key: :summary,
|
155
|
+
env_name: "AC_SUMMARY",
|
156
|
+
description: "Provide a summary for the application to be published. This summary will be displayed in the Appcircle Enterprise App Store",
|
157
|
+
optional: false,
|
158
|
+
type: String),
|
159
|
+
|
160
|
+
FastlaneCore::ConfigItem.new(key: :releaseNotes,
|
161
|
+
env_name: "AC_RELEASE_NOTES",
|
162
|
+
description: "Provide release notes for the application to be published. These notes will be displayed in the Appcircle Enterprise App Store",
|
163
|
+
optional: false,
|
164
|
+
type: String),
|
165
|
+
|
166
|
+
FastlaneCore::ConfigItem.new(key: :publishType,
|
167
|
+
env_name: "AC_PUBLISH_TYPE",
|
168
|
+
description: "Specify the publish type for the application. This can be 0: None, 1: Beta, 2: Live. Default is 0: None. For more information, provide the number of the publish type",
|
169
|
+
optional: false,
|
170
|
+
type: String),
|
171
|
+
]
|
172
|
+
end
|
173
|
+
|
174
|
+
def self.is_supported?(platform)
|
175
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
176
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
177
|
+
#
|
178
|
+
# [:ios, :mac, :android].include?(platform)
|
179
|
+
true
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
data/lib/fastlane/plugin/appcircle_enterprise_store/helper/appcircle_enterprise_store_helper.rb
ADDED
@@ -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 AppcircleEnterpriseStoreHelper
|
8
|
+
# class methods that you define here become available in your action
|
9
|
+
# as `Helper::AppcircleEnterpriseStoreHelper.your_method`
|
10
|
+
#
|
11
|
+
def self.show_message
|
12
|
+
UI.message("Hello from the appcircle_enterprise_store plugin helper!")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/appcircle_enterprise_store/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module AppcircleEnterpriseStore
|
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::AppcircleEnterpriseStore.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-appcircle_enterprise_store
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- appcircleio
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-06-11 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description:
|
14
|
+
email: cloud@appcircle.io
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- LICENSE
|
20
|
+
- README.md
|
21
|
+
- images/PAT.png
|
22
|
+
- images/ent_app_store.png
|
23
|
+
- images/extension-icon.png
|
24
|
+
- lib/fastlane/plugin/appcircle_enterprise_store.rb
|
25
|
+
- lib/fastlane/plugin/appcircle_enterprise_store/actions/appcircle_enterprise_store_action.rb
|
26
|
+
- lib/fastlane/plugin/appcircle_enterprise_store/helper/appcircle_enterprise_store_helper.rb
|
27
|
+
- lib/fastlane/plugin/appcircle_enterprise_store/version.rb
|
28
|
+
homepage: https://github.com/appcircleio/fastlane-plugin-appcircle_enterprise_store
|
29
|
+
licenses:
|
30
|
+
- MIT
|
31
|
+
metadata:
|
32
|
+
rubygems_mfa_required: 'false'
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '2.6'
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
requirements: []
|
48
|
+
rubygems_version: 3.4.10
|
49
|
+
signing_key:
|
50
|
+
specification_version: 4
|
51
|
+
summary: Efficiently publish your apps to Appcircle Enterprise Store
|
52
|
+
test_files: []
|