fastlane-plugin-pcloudy 0.2.1 → 0.3.1
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 +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +369 -63
- data/lib/fastlane/plugin/pcloudy/actions/pcloudy_list_devices_action.rb +12 -1
- data/lib/fastlane/plugin/pcloudy/actions/pcloudy_resign_app_action.rb +2 -2
- data/lib/fastlane/plugin/pcloudy/actions/pcloudy_upload_app_action.rb +16 -11
- data/lib/fastlane/plugin/pcloudy/helper/pcloudy_options.rb +9 -0
- data/lib/fastlane/plugin/pcloudy/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c69d7626da330b6b8ac015de46582208494700304131a334d593f39607373fd
|
|
4
|
+
data.tar.gz: 12fff2303d1afbd9b9d99f602e537be47a6573b205c2c02e5d71e5ee715e6d47
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2038af9094e39eeba6790cb69f9715c6eb3ccb5bbd0c25b3a06c3909a5843b61126c402bf4233649eb3023033216fa016080fc850e8f7367efa5cdba55d10f51
|
|
7
|
+
data.tar.gz: 36d245a82497c285e495a955124061632ee2e2554bf625f621bfeb489dc4161d755f6849b95e20e0735def17bb98bcd47b06555ec94ab1852cb817a642871715
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.1
|
|
4
|
+
|
|
5
|
+
- `fastlane run pcloudy_list_devices` no longer dumps every field of every device after the table: the
|
|
6
|
+
result now prints as a one-line summary ("Result: 21 pCloudy device(s)"). Lanes still get the full array.
|
|
7
|
+
- With `available_now: true` (the default), devices that pCloudy reports as available but `offline` are no
|
|
8
|
+
longer listed, since they can't be used.
|
|
9
|
+
- README rewritten as an integration guide: requirements, security, CI/CD examples, Appium integration,
|
|
10
|
+
error handling and troubleshooting.
|
|
11
|
+
|
|
12
|
+
## 0.3.0
|
|
13
|
+
|
|
14
|
+
- `pcloudy_upload_app` and `pcloudy_resign_app` now also set `PCLOUDY_UPLOADED_FILE`, `PCLOUDY_RESIGNED_FILE`
|
|
15
|
+
and `PCLOUDY_APP_FILE` as environment variables, so Appium test runners started with `sh` can read
|
|
16
|
+
`PCLOUDY_APP_FILE` directly.
|
|
17
|
+
- A new upload without `resign` clears `PCLOUDY_RESIGNED_FILE`, so it never points at an earlier app.
|
|
18
|
+
- `pcloudy_upload_app` accepts Android App Bundles (`.aab`) and uses the `.aab` from `gradle` bundle tasks
|
|
19
|
+
when no `.ipa` or `.apk` was built.
|
|
20
|
+
|
|
3
21
|
## 0.2.1
|
|
4
22
|
|
|
5
23
|
- Network failures such as timeouts, dropped connections during large uploads, and unreachable hosts
|
data/README.md
CHANGED
|
@@ -1,130 +1,436 @@
|
|
|
1
1
|
# fastlane-plugin-pcloudy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-pcloudy)
|
|
4
|
+
[](https://rubygems.org/gems/fastlane-plugin-pcloudy)
|
|
5
|
+
[](LICENSE)
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
The official [fastlane](https://fastlane.tools) plugin for [pCloudy](https://www.pcloudy.com), the real-device
|
|
8
|
+
cloud for iOS and Android. Connect your build pipeline to pCloudy: upload every build automatically, re-sign iOS
|
|
9
|
+
apps for pCloudy devices, find available devices, and hand the uploaded app to your Appium test suite, all from
|
|
10
|
+
your existing `Fastfile`.
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Contents
|
|
15
|
+
|
|
16
|
+
- [Why use it](#why-use-it)
|
|
17
|
+
- [Capabilities](#capabilities)
|
|
18
|
+
- [Requirements](#requirements)
|
|
19
|
+
- [Installation](#installation)
|
|
20
|
+
- [Authentication and security](#authentication-and-security)
|
|
21
|
+
- [Quick start](#quick-start)
|
|
22
|
+
- [CI/CD integration](#cicd-integration)
|
|
23
|
+
- [Appium integration](#appium-integration)
|
|
24
|
+
- [Action reference](#action-reference)
|
|
25
|
+
- [Outputs and environment variables](#outputs-and-environment-variables)
|
|
26
|
+
- [Private and on-premise clouds](#private-and-on-premise-clouds)
|
|
27
|
+
- [Network requirements](#network-requirements)
|
|
28
|
+
- [Error handling](#error-handling)
|
|
29
|
+
- [Troubleshooting](#troubleshooting)
|
|
30
|
+
- [Versioning and support](#versioning-and-support)
|
|
31
|
+
- [Development](#development)
|
|
32
|
+
- [License](#license)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Why use it
|
|
37
|
+
|
|
38
|
+
- **No manual uploads.** Every CI build lands in pCloudy **My Apps** automatically, under the exact name pCloudy
|
|
39
|
+
assigned to it.
|
|
40
|
+
- **No iOS signing setup for testing.** Upload an `.ipa`, and the plugin has pCloudy re-sign it with
|
|
41
|
+
pCloudy's certificate so it installs on pCloudy iPhones and iPads. This works even for an **unsigned** `.ipa`,
|
|
42
|
+
so a test pipeline needs no Apple certificates or provisioning profiles.
|
|
43
|
+
- **Ready for test automation.** The uploaded app's name is exported as `PCLOUDY_APP_FILE`, so Appium suites
|
|
44
|
+
(Java, Python, JavaScript, …) pick it up with no extra wiring.
|
|
45
|
+
- **Device-aware pipelines.** Check which devices are free right now and filter by platform, OS version,
|
|
46
|
+
manufacturer or model before you start a test run.
|
|
47
|
+
- **Built for CI.** Credentials come from environment variables, secrets are masked in logs, and every failure
|
|
48
|
+
stops the lane with one clear message instead of a stack trace.
|
|
49
|
+
|
|
50
|
+
## Capabilities
|
|
51
|
+
|
|
52
|
+
| Action | What it does |
|
|
53
|
+
|---|---|
|
|
54
|
+
| [`pcloudy_upload_app`](#pcloudy_upload_app) | Uploads an `.ipa`, `.apk` or `.aab` to My Apps, waits until pCloudy has registered it, and optionally re-signs the `.ipa`. Uses the output of `build_app` / `gradle` automatically. |
|
|
55
|
+
| [`pcloudy_resign_app`](#pcloudy_resign_app) | Re-signs an `.ipa` that's already in My Apps with pCloudy's certificate and waits for it to finish. |
|
|
56
|
+
| [`pcloudy_list_devices`](#pcloudy_list_devices) | Lists real iOS and Android devices, filtered by availability, platform, OS version, manufacturer and name. |
|
|
57
|
+
|
|
58
|
+
**Supported app formats:** `.ipa` (iOS, signed or unsigned), `.apk` and `.aab` (Android).
|
|
59
|
+
|
|
60
|
+
**Roadmap:** booking and releasing devices, installing and launching an app on a booked device, and running
|
|
61
|
+
XCUITest / Espresso / Appium suites with results reported back to the lane.
|
|
62
|
+
|
|
63
|
+
## Requirements
|
|
64
|
+
|
|
65
|
+
| Component | Supported |
|
|
6
66
|
|---|---|
|
|
7
|
-
|
|
|
8
|
-
|
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
67
|
+
| fastlane | 2.220 or later |
|
|
68
|
+
| Ruby | 2.6 or later (Ruby 3.x recommended) |
|
|
69
|
+
| Build machine | macOS for iOS builds; macOS or Linux for Android and for uploads only |
|
|
70
|
+
| pCloudy | A pCloudy account with API access: public cloud ([device.pcloudy.com](https://device.pcloudy.com)), private cloud or on-premise |
|
|
71
|
+
|
|
72
|
+
> **macOS tip:** use Ruby from Homebrew (`brew install ruby`) or a version manager, not the system Ruby 2.6.
|
|
73
|
+
> Older Bundler versions that come with it crash on Ruby 3.2+ with ``undefined method `untaint'``.
|
|
12
74
|
|
|
13
75
|
## Installation
|
|
14
76
|
|
|
77
|
+
From the root of your app project:
|
|
78
|
+
|
|
15
79
|
```bash
|
|
16
|
-
fastlane add_plugin pcloudy
|
|
80
|
+
bundle exec fastlane add_plugin pcloudy
|
|
17
81
|
```
|
|
18
82
|
|
|
19
|
-
This adds
|
|
83
|
+
This adds the gem to `fastlane/Pluginfile`. Commit `Gemfile`, `Gemfile.lock` and `fastlane/Pluginfile` so every
|
|
84
|
+
developer and CI agent uses the same version.
|
|
20
85
|
|
|
21
|
-
|
|
86
|
+
To pin a version for reproducible builds, edit `fastlane/Pluginfile`:
|
|
87
|
+
|
|
88
|
+
```ruby
|
|
89
|
+
gem "fastlane-plugin-pcloudy", "~> 0.3"
|
|
90
|
+
```
|
|
22
91
|
|
|
23
|
-
|
|
92
|
+
To update later:
|
|
24
93
|
|
|
94
|
+
```bash
|
|
95
|
+
bundle update fastlane-plugin-pcloudy
|
|
25
96
|
```
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
97
|
+
|
|
98
|
+
## Authentication and security
|
|
99
|
+
|
|
100
|
+
The plugin signs in with your pCloudy **username** (the account email) and **API key** (pCloudy →
|
|
101
|
+
**Settings** → **API Key**).
|
|
102
|
+
|
|
103
|
+
| Setting | Environment variable | Notes |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| `username` | `PCLOUDY_USERNAME` | pCloudy account email |
|
|
106
|
+
| `api_key` | `PCLOUDY_API_KEY` | Marked sensitive: fastlane masks it in logs and summaries |
|
|
107
|
+
| `cloud_url` | `PCLOUDY_CLOUD_URL` | Optional. Defaults to `https://device.pcloudy.com` |
|
|
108
|
+
|
|
109
|
+
**Local development:** put the values in `fastlane/.env` and add that file to `.gitignore`:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# fastlane/.env (never commit this file)
|
|
113
|
+
PCLOUDY_USERNAME=qa-automation@your-company.com
|
|
114
|
+
PCLOUDY_API_KEY=<your API key>
|
|
29
115
|
```
|
|
30
116
|
|
|
117
|
+
**CI:** store both values in your CI system's secret store (GitHub Actions secrets, Jenkins credentials,
|
|
118
|
+
GitLab CI/CD variables, …) and expose them as environment variables. Never hard-code them in the `Fastfile`.
|
|
119
|
+
|
|
120
|
+
**Security notes**
|
|
121
|
+
|
|
122
|
+
- Credentials are sent only to the configured `cloud_url`, over HTTPS.
|
|
123
|
+
- The plugin exchanges the API key for a pCloudy session token, kept in memory for the current run only. It
|
|
124
|
+
doesn't write credentials or tokens to disk or to the log.
|
|
125
|
+
- Use a dedicated pCloudy account for automation, so its API key can be rotated without affecting people.
|
|
126
|
+
- Rotate the API key whenever it may have been exposed, for example after it has been pasted into a ticket or a chat.
|
|
127
|
+
- Releases of this gem require multi-factor authentication on RubyGems (`rubygems_mfa_required`).
|
|
128
|
+
|
|
129
|
+
**Data handled:** the app binary you upload is stored in your pCloudy account's **My Apps**. Re-signing creates
|
|
130
|
+
an additional copy there with `_Resigned` in its name. The plugin doesn't send any other data from the
|
|
131
|
+
build machine.
|
|
132
|
+
|
|
31
133
|
## Quick start
|
|
32
134
|
|
|
33
135
|
```ruby
|
|
34
|
-
#
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
136
|
+
# fastlane/Fastfile
|
|
137
|
+
|
|
138
|
+
platform :ios do
|
|
139
|
+
desc "Build, upload to pCloudy and re-sign for pCloudy devices"
|
|
140
|
+
lane :pcloudy do
|
|
141
|
+
build_app(scheme: "MyApp", export_method: "development")
|
|
142
|
+
pcloudy_upload_app(resign: true)
|
|
143
|
+
end
|
|
38
144
|
end
|
|
39
145
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
146
|
+
platform :android do
|
|
147
|
+
desc "Build and upload to pCloudy"
|
|
148
|
+
lane :pcloudy do
|
|
149
|
+
gradle(task: "assembleDebug") # or "bundleRelease" for an .aab
|
|
150
|
+
pcloudy_upload_app
|
|
151
|
+
end
|
|
44
152
|
end
|
|
45
153
|
```
|
|
46
154
|
|
|
47
|
-
|
|
155
|
+
```bash
|
|
156
|
+
bundle exec fastlane ios pcloudy
|
|
157
|
+
bundle exec fastlane android pcloudy
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The app appears in **pCloudy → My Apps**, ready to install on real devices manually or from automated tests.
|
|
161
|
+
|
|
162
|
+
Check your setup at any time:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
bundle exec fastlane run pcloudy_list_devices platform:ios
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## CI/CD integration
|
|
169
|
+
|
|
170
|
+
### GitHub Actions
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
# .github/workflows/pcloudy.yml
|
|
174
|
+
name: pCloudy
|
|
175
|
+
on: [push]
|
|
176
|
+
|
|
177
|
+
jobs:
|
|
178
|
+
ios:
|
|
179
|
+
runs-on: macos-latest
|
|
180
|
+
steps:
|
|
181
|
+
- uses: actions/checkout@v4
|
|
182
|
+
- uses: ruby/setup-ruby@v1
|
|
183
|
+
with:
|
|
184
|
+
bundler-cache: true
|
|
185
|
+
- run: bundle exec fastlane ios pcloudy
|
|
186
|
+
env:
|
|
187
|
+
PCLOUDY_USERNAME: ${{ secrets.PCLOUDY_USERNAME }}
|
|
188
|
+
PCLOUDY_API_KEY: ${{ secrets.PCLOUDY_API_KEY }}
|
|
189
|
+
|
|
190
|
+
android:
|
|
191
|
+
runs-on: ubuntu-latest
|
|
192
|
+
steps:
|
|
193
|
+
- uses: actions/checkout@v4
|
|
194
|
+
- uses: actions/setup-java@v4
|
|
195
|
+
with:
|
|
196
|
+
distribution: temurin
|
|
197
|
+
java-version: "17"
|
|
198
|
+
- uses: ruby/setup-ruby@v1
|
|
199
|
+
with:
|
|
200
|
+
bundler-cache: true
|
|
201
|
+
- run: bundle exec fastlane android pcloudy
|
|
202
|
+
env:
|
|
203
|
+
PCLOUDY_USERNAME: ${{ secrets.PCLOUDY_USERNAME }}
|
|
204
|
+
PCLOUDY_API_KEY: ${{ secrets.PCLOUDY_API_KEY }}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Jenkins (declarative pipeline)
|
|
208
|
+
|
|
209
|
+
```groovy
|
|
210
|
+
pipeline {
|
|
211
|
+
agent { label 'macos' }
|
|
212
|
+
environment {
|
|
213
|
+
PCLOUDY_USERNAME = credentials('pcloudy-username')
|
|
214
|
+
PCLOUDY_API_KEY = credentials('pcloudy-api-key')
|
|
215
|
+
}
|
|
216
|
+
stages {
|
|
217
|
+
stage('Install') { steps { sh 'bundle install' } }
|
|
218
|
+
stage('pCloudy') { steps { sh 'bundle exec fastlane ios pcloudy' } }
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### GitLab CI
|
|
48
224
|
|
|
49
|
-
|
|
225
|
+
```yaml
|
|
226
|
+
# .gitlab-ci.yml. Set PCLOUDY_USERNAME and PCLOUDY_API_KEY as masked CI/CD variables.
|
|
227
|
+
pcloudy_android:
|
|
228
|
+
image: ruby:3.3
|
|
229
|
+
script:
|
|
230
|
+
- bundle install
|
|
231
|
+
- bundle exec fastlane android pcloudy
|
|
232
|
+
```
|
|
50
233
|
|
|
51
|
-
|
|
234
|
+
For Android, the job's image also needs a JDK and the Android SDK, or a prebuilt APK/AAB passed with
|
|
235
|
+
`file:`.
|
|
52
236
|
|
|
53
|
-
|
|
237
|
+
## Appium integration
|
|
238
|
+
|
|
239
|
+
`pcloudy_upload_app` and `pcloudy_resign_app` export the uploaded app's name as the environment variable
|
|
240
|
+
`PCLOUDY_APP_FILE`. Any test runner started from the lane inherits it.
|
|
241
|
+
|
|
242
|
+
```ruby
|
|
243
|
+
platform :ios do
|
|
244
|
+
lane :pcloudy_tests do
|
|
245
|
+
build_app(scheme: "MyApp", export_method: "development")
|
|
246
|
+
pcloudy_upload_app(resign: true) # sets ENV["PCLOUDY_APP_FILE"] to the re-signed name
|
|
247
|
+
|
|
248
|
+
device = pcloudy_list_devices(platform: "ios", os_version: "17", print_table: false).first
|
|
249
|
+
UI.user_error!("No free iOS 17 device on pCloudy") unless device
|
|
250
|
+
ENV["PCLOUDY_DEVICE"] = device["full_name"]
|
|
251
|
+
|
|
252
|
+
sh("cd .. && mvn test") # or: pytest, npm test, gradle test, ...
|
|
253
|
+
end
|
|
254
|
+
end
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
In the test suite, read the values from the environment:
|
|
258
|
+
|
|
259
|
+
```java
|
|
260
|
+
caps.setCapability("pCloudy_Username", System.getenv("PCLOUDY_USERNAME"));
|
|
261
|
+
caps.setCapability("pCloudy_ApiKey", System.getenv("PCLOUDY_API_KEY"));
|
|
262
|
+
caps.setCapability("pCloudy_ApplicationName", System.getenv("PCLOUDY_APP_FILE"));
|
|
263
|
+
caps.setCapability("pCloudy_DeviceFullName", System.getenv("PCLOUDY_DEVICE"));
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
```python
|
|
267
|
+
caps["pCloudy_ApplicationName"] = os.environ["PCLOUDY_APP_FILE"]
|
|
268
|
+
caps["pCloudy_DeviceFullName"] = os.environ["PCLOUDY_DEVICE"]
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
See pCloudy's Appium documentation for the full list of capabilities and the hub URL for your cloud.
|
|
272
|
+
|
|
273
|
+
> **Always use `PCLOUDY_APP_FILE`, not the local file name.** pCloudy renames an upload (adding a timestamp)
|
|
274
|
+
> when a file with the same name already exists, and re-signing produces a new `_Resigned` file.
|
|
275
|
+
|
|
276
|
+
## Action reference
|
|
277
|
+
|
|
278
|
+
All actions accept `username`, `api_key` and `cloud_url` (see
|
|
279
|
+
[Authentication and security](#authentication-and-security)).
|
|
280
|
+
|
|
281
|
+
### `pcloudy_upload_app`
|
|
282
|
+
|
|
283
|
+
Uploads an app to pCloudy My Apps. Platforms: iOS, Android.
|
|
54
284
|
|
|
55
285
|
```ruby
|
|
56
|
-
pcloudy_upload_app
|
|
57
|
-
pcloudy_upload_app(resign: true)
|
|
58
|
-
|
|
286
|
+
pcloudy_upload_app # output of build_app / gradle
|
|
287
|
+
pcloudy_upload_app(resign: true) # iOS: upload and re-sign in one step
|
|
288
|
+
pcloudy_upload_app(file: "build/MyApp.aab") # any file
|
|
59
289
|
```
|
|
60
290
|
|
|
61
|
-
|
|
291
|
+
If `file:` is omitted, the plugin uses, in this order: the `.ipa` from `build_app`/`gym`, the `.apk` from
|
|
292
|
+
`gradle` (`assemble…` tasks), then the `.aab` from `gradle` (`bundle…` tasks).
|
|
293
|
+
|
|
294
|
+
| Option | Environment variable | Default | Description |
|
|
62
295
|
|---|---|---|---|
|
|
63
|
-
| `file` | `PCLOUDY_APP_PATH` | output
|
|
296
|
+
| `file` | `PCLOUDY_APP_PATH` | build output | Path to the `.ipa`, `.apk` or `.aab` |
|
|
64
297
|
| `resign` | `PCLOUDY_RESIGN` | `false` | Re-sign the `.ipa` after uploading (iOS only) |
|
|
65
298
|
| `wait_for_processing` | `PCLOUDY_WAIT_FOR_PROCESSING` | `true` | Wait until the file appears in My Apps |
|
|
66
|
-
| `upload_timeout` | `PCLOUDY_UPLOAD_TIMEOUT` | `600` | Seconds allowed for the upload |
|
|
299
|
+
| `upload_timeout` | `PCLOUDY_UPLOAD_TIMEOUT` | `600` | Seconds allowed for the upload request |
|
|
67
300
|
| `processing_timeout` | `PCLOUDY_PROCESSING_TIMEOUT` | `120` | Seconds to wait for the file to appear in My Apps |
|
|
68
301
|
| `resign_timeout` | `PCLOUDY_RESIGN_TIMEOUT` | `600` | Seconds to wait for re-signing (with `resign: true`) |
|
|
69
|
-
| `poll_interval` | — | `5` | Seconds between re-sign progress checks
|
|
70
|
-
|
|
71
|
-
Plus `username`, `api_key` and `cloud_url`, as for every action.
|
|
302
|
+
| `poll_interval` | — | `5` | Seconds between re-sign progress checks |
|
|
72
303
|
|
|
73
304
|
**Returns:** the file name in My Apps (the re-signed copy when `resign: true`).
|
|
74
|
-
**Sets:** `PCLOUDY_UPLOADED_FILE`, `PCLOUDY_APP_FILE`, and with `resign: true`, `PCLOUDY_RESIGNED_FILE`.
|
|
75
305
|
|
|
76
|
-
|
|
306
|
+
### `pcloudy_resign_app`
|
|
77
307
|
|
|
78
|
-
Re-signs an `.ipa`
|
|
308
|
+
Re-signs an `.ipa` already in My Apps with pCloudy's certificate, so it installs on pCloudy iPhones and iPads.
|
|
309
|
+
Platform: iOS.
|
|
79
310
|
|
|
80
311
|
```ruby
|
|
81
312
|
pcloudy_upload_app
|
|
82
|
-
pcloudy_resign_app
|
|
313
|
+
pcloudy_resign_app # re-signs the last upload
|
|
83
314
|
|
|
84
|
-
pcloudy_resign_app(file: "MyApp-1794551836.ipa")
|
|
315
|
+
pcloudy_resign_app(file: "MyApp-1794551836.ipa") # a file already in My Apps
|
|
85
316
|
```
|
|
86
317
|
|
|
87
|
-
| Option |
|
|
318
|
+
| Option | Environment variable | Default | Description |
|
|
88
319
|
|---|---|---|---|
|
|
89
|
-
| `file` | `PCLOUDY_RESIGN_FILE` | last upload | File name in
|
|
320
|
+
| `file` | `PCLOUDY_RESIGN_FILE` | last upload | File name in My Apps |
|
|
90
321
|
| `timeout` | `PCLOUDY_RESIGN_TIMEOUT` | `600` | Seconds to wait for re-signing to finish |
|
|
91
322
|
| `poll_interval` | — | `5` | Seconds between progress checks |
|
|
92
323
|
|
|
93
324
|
**Returns:** the re-signed file name, e.g. `MyApp-1794551836_Resigned1794551854668.ipa`.
|
|
94
|
-
**Sets:** `PCLOUDY_RESIGNED_FILE` and `PCLOUDY_APP_FILE`.
|
|
95
325
|
|
|
96
|
-
|
|
326
|
+
### `pcloudy_list_devices`
|
|
327
|
+
|
|
328
|
+
Lists real devices on pCloudy. Platforms: iOS, Android.
|
|
97
329
|
|
|
98
330
|
```ruby
|
|
99
|
-
pcloudy_list_devices
|
|
100
|
-
pcloudy_list_devices(platform: "ios", os_version: "17")
|
|
101
|
-
devices = pcloudy_list_devices(platform: "android",
|
|
102
|
-
manufacturer: "Samsung",
|
|
103
|
-
print_table: false)
|
|
104
|
-
UI.message("First device id: #{devices.first['id']}")
|
|
331
|
+
pcloudy_list_devices # all devices free right now
|
|
332
|
+
pcloudy_list_devices(platform: "ios", os_version: "17") # iOS 17.x
|
|
333
|
+
devices = pcloudy_list_devices(platform: "android", manufacturer: "Samsung", print_table: false)
|
|
105
334
|
```
|
|
106
335
|
|
|
107
|
-
| Option |
|
|
336
|
+
| Option | Environment variable | Default | Description |
|
|
108
337
|
|---|---|---|---|
|
|
109
|
-
| `username` | `PCLOUDY_USERNAME` | — | pCloudy account email |
|
|
110
|
-
| `api_key` | `PCLOUDY_API_KEY` | — | pCloudy API key |
|
|
111
|
-
| `cloud_url` | `PCLOUDY_CLOUD_URL` | `https://device.pcloudy.com` | Cloud URL |
|
|
112
338
|
| `platform` | `PCLOUDY_PLATFORM` | `all` | `ios`, `android` or `all` |
|
|
113
|
-
| `available_now` | `PCLOUDY_AVAILABLE_NOW` | `true` | Only devices that are free now |
|
|
114
|
-
| `duration` | `PCLOUDY_DURATION` | `10` |
|
|
115
|
-
| `os_version` | `PCLOUDY_OS_VERSION` | — | OS version or prefix
|
|
116
|
-
| `manufacturer` | `PCLOUDY_MANUFACTURER` | — | e.g. `Apple`, `Samsung` |
|
|
117
|
-
| `name` | `PCLOUDY_DEVICE_NAME` | — | Text in the device name, e.g. `iPhone 15` |
|
|
118
|
-
| `print_table` | — | `true` | Print
|
|
339
|
+
| `available_now` | `PCLOUDY_AVAILABLE_NOW` | `true` | Only devices that are free right now |
|
|
340
|
+
| `duration` | `PCLOUDY_DURATION` | `10` | Booking length in minutes used for the availability check |
|
|
341
|
+
| `os_version` | `PCLOUDY_OS_VERSION` | — | OS version or prefix: `17` matches 17.x, `17.5` matches 17.5.x |
|
|
342
|
+
| `manufacturer` | `PCLOUDY_MANUFACTURER` | — | e.g. `Apple`, `Samsung` (case-insensitive) |
|
|
343
|
+
| `name` | `PCLOUDY_DEVICE_NAME` | — | Text in the device name, e.g. `iPhone 15` (ignores case and spaces) |
|
|
344
|
+
| `print_table` | — | `true` | Print the results as a table |
|
|
345
|
+
|
|
346
|
+
**Returns:** an array of device hashes with `id`, `full_name`, `display_name`, `model`, `manufacturer`,
|
|
347
|
+
`platform`, `version`, `available`, and more.
|
|
348
|
+
|
|
349
|
+
## Outputs and environment variables
|
|
350
|
+
|
|
351
|
+
Each result is available both in fastlane's `lane_context` and as an environment variable, so it can be read in
|
|
352
|
+
the `Fastfile` and by any process the lane starts.
|
|
119
353
|
|
|
120
|
-
|
|
354
|
+
| Name | Set by | Value |
|
|
355
|
+
|---|---|---|
|
|
356
|
+
| `PCLOUDY_APP_FILE` | upload, resign | **The file to test**: the re-signed copy if there is one, otherwise the upload |
|
|
357
|
+
| `PCLOUDY_UPLOADED_FILE` | upload | The name pCloudy stored the upload under |
|
|
358
|
+
| `PCLOUDY_RESIGNED_FILE` | upload with `resign: true`, resign | The re-signed file name. Cleared by a new upload without `resign` |
|
|
359
|
+
| `PCLOUDY_DEVICES` | list devices | The matching devices (`lane_context` only) |
|
|
360
|
+
|
|
361
|
+
```ruby
|
|
362
|
+
app = lane_context[SharedValues::PCLOUDY_APP_FILE] # in the Fastfile
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
## Private and on-premise clouds
|
|
366
|
+
|
|
367
|
+
Point the plugin at your cloud with `cloud_url` or `PCLOUDY_CLOUD_URL`:
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
PCLOUDY_CLOUD_URL=https://your-company.pcloudy.com
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
The scheme is optional (`your-company.pcloudy.com` is treated as `https://your-company.pcloudy.com`), and a
|
|
374
|
+
trailing slash is ignored.
|
|
375
|
+
|
|
376
|
+
## Network requirements
|
|
377
|
+
|
|
378
|
+
- Outbound **HTTPS (port 443)** from the build machine to the `cloud_url` host.
|
|
379
|
+
- Uploads send the full app binary, so allow for large request bodies and adjust `upload_timeout` on slow links.
|
|
380
|
+
- **Proxies:** Ruby's HTTP client, which the plugin uses, reads the `http_proxy` and `no_proxy` environment variables.
|
|
381
|
+
|
|
382
|
+
## Error handling
|
|
383
|
+
|
|
384
|
+
Every failure stops the lane with a single, readable `fastlane` error, so CI logs show the cause directly:
|
|
385
|
+
|
|
386
|
+
| Situation | Message |
|
|
387
|
+
|---|---|
|
|
388
|
+
| Missing credentials | `No value found for 'username'` |
|
|
389
|
+
| Wrong username or API key | `pCloudy /api/access failed: wrong user name` |
|
|
390
|
+
| HTTP error from pCloudy | `pCloudy /api/... returned HTTP 401: <pCloudy's message>` |
|
|
391
|
+
| Network failure (DNS, timeout, refused or dropped connection, TLS) | `Could not reach pCloudy at https://…: <reason>` |
|
|
392
|
+
| Unsupported file | `Unsupported file type '.zip'. pCloudy apps must be .ipa, .apk, .aab` |
|
|
393
|
+
| Re-signing a non-iOS app | `Only iOS apps (.ipa) can be re-signed on pCloudy` |
|
|
394
|
+
| Upload not registered in time | `<name> did not appear in pCloudy My Apps within 120s` |
|
|
395
|
+
| Re-signing not finished in time | `Re-signing <name> did not finish within 600s (last progress 40%)` |
|
|
396
|
+
|
|
397
|
+
Network failures are not retried automatically. For an unreliable connection, retry the lane step in your CI
|
|
398
|
+
configuration.
|
|
399
|
+
|
|
400
|
+
## Troubleshooting
|
|
401
|
+
|
|
402
|
+
| Problem | Fix |
|
|
403
|
+
|---|---|
|
|
404
|
+
| ``undefined method `untaint'`` when running fastlane | An old Bundler is running on a new Ruby. Use Homebrew's or a version manager's Ruby, and always run `bundle exec fastlane`. |
|
|
405
|
+
| `No value found for 'username'` | `PCLOUDY_USERNAME` / `PCLOUDY_API_KEY` are not set. Check `fastlane/.env` or your CI secrets, and run from the project root. |
|
|
406
|
+
| `wrong user name` | The username or API key is wrong, or the key was regenerated. Copy it again from pCloudy → Settings → API Key. |
|
|
407
|
+
| The app doesn't install on an iOS device | Upload with `resign: true` and install the `_Resigned` file (`PCLOUDY_APP_FILE`). |
|
|
408
|
+
| Appium reports "application not found" | Use `PCLOUDY_APP_FILE`, not the local file name. pCloudy may have renamed the upload. |
|
|
409
|
+
| `Could not reach pCloudy` | Check VPN or proxy settings, firewall rules for port 443 and `PCLOUDY_CLOUD_URL`. |
|
|
410
|
+
| `did not appear in pCloudy My Apps` | pCloudy is slow to process large files. Raise `processing_timeout`. |
|
|
411
|
+
| No devices returned | All matching devices are busy. Try `available_now: false` to see every device, or relax the filters. |
|
|
412
|
+
|
|
413
|
+
## Versioning and support
|
|
414
|
+
|
|
415
|
+
- The plugin follows [Semantic Versioning](https://semver.org). Changes are listed in [CHANGELOG.md](CHANGELOG.md),
|
|
416
|
+
which ships with the gem.
|
|
417
|
+
- Published on RubyGems as [`fastlane-plugin-pcloudy`](https://rubygems.org/gems/fastlane-plugin-pcloudy),
|
|
418
|
+
maintained by pCloudy.
|
|
419
|
+
- For help, contact pCloudy support through [pcloudy.com](https://www.pcloudy.com) or your pCloudy account
|
|
420
|
+
team. Include the plugin version (`bundle exec gem list fastlane-plugin-pcloudy`), the fastlane version and
|
|
421
|
+
the error message.
|
|
422
|
+
- To report a security issue, contact pCloudy privately rather than posting it publicly.
|
|
121
423
|
|
|
122
424
|
## Development
|
|
123
425
|
|
|
124
426
|
```bash
|
|
125
427
|
bundle install
|
|
126
|
-
bundle exec rspec
|
|
127
|
-
bundle exec fastlane list_devices platform:ios
|
|
428
|
+
bundle exec rspec # unit tests (all HTTP calls are stubbed)
|
|
429
|
+
bundle exec fastlane list_devices platform:ios # live calls; needs fastlane/.env
|
|
128
430
|
bundle exec fastlane upload file:/path/App.ipa resign:true
|
|
129
431
|
bundle exec fastlane resign file:App-1794551836.ipa
|
|
130
432
|
```
|
|
433
|
+
|
|
434
|
+
## License
|
|
435
|
+
|
|
436
|
+
[MIT](LICENSE) © Smart Software Testing Solutions
|
|
@@ -21,7 +21,7 @@ module Fastlane
|
|
|
21
21
|
available_now: params[:available_now])
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
devices = filter(devices, params)
|
|
24
|
+
devices = DeviceList.new(filter(devices, params))
|
|
25
25
|
|
|
26
26
|
print_table(devices, params) if params[:print_table]
|
|
27
27
|
UI.success("Found #{devices.count} pCloudy device(s)")
|
|
@@ -32,8 +32,19 @@ module Fastlane
|
|
|
32
32
|
UI.user_error!(e.message)
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
# An ordinary Array of device hashes for lanes, which prints as a one-line summary. `fastlane run` prints
|
|
36
|
+
# "Result: <return value>"; without this it would dump every field of every device on one line.
|
|
37
|
+
class DeviceList < Array
|
|
38
|
+
def to_s
|
|
39
|
+
"#{size} pCloudy device(s)"
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
35
43
|
def self.filter(devices, params)
|
|
36
44
|
devices.select do |device|
|
|
45
|
+
# pCloudy can report a device as available while it's offline; it can't be used then.
|
|
46
|
+
next false if params[:available_now] && device["status"].to_s.casecmp?("offline")
|
|
47
|
+
|
|
37
48
|
matches_version?(device["version"], params[:os_version]) &&
|
|
38
49
|
matches_text?(device["manufacturer"], params[:manufacturer]) &&
|
|
39
50
|
matches_name?(device, params[:name])
|
|
@@ -12,8 +12,8 @@ module Fastlane
|
|
|
12
12
|
client = Helper::PcloudyOptions.client(params)
|
|
13
13
|
signed = Helper::PcloudyOptions.resign(client, filename, timeout: params[:timeout], interval: params[:poll_interval])
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
Helper::PcloudyOptions.export(SharedValues::PCLOUDY_RESIGNED_FILE, signed)
|
|
16
|
+
Helper::PcloudyOptions.export(SharedValues::PCLOUDY_APP_FILE, signed)
|
|
17
17
|
signed
|
|
18
18
|
rescue Helper::PcloudyClient::Error => e
|
|
19
19
|
UI.user_error!(e.message)
|
|
@@ -10,7 +10,7 @@ module Fastlane
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
class PcloudyUploadAppAction < Action
|
|
13
|
-
EXTENSIONS = %w(.ipa .apk).freeze
|
|
13
|
+
EXTENSIONS = %w(.ipa .apk .aab).freeze
|
|
14
14
|
|
|
15
15
|
def self.run(params)
|
|
16
16
|
path = params[:file] || default_file
|
|
@@ -19,7 +19,7 @@ module Fastlane
|
|
|
19
19
|
path = File.expand_path(path)
|
|
20
20
|
UI.user_error!("File not found: #{path}") unless File.file?(path)
|
|
21
21
|
ext = File.extname(path).downcase
|
|
22
|
-
UI.user_error!("Unsupported file type '#{ext}'. pCloudy apps must be #{EXTENSIONS.join('
|
|
22
|
+
UI.user_error!("Unsupported file type '#{ext}'. pCloudy apps must be #{EXTENSIONS.join(', ')}") unless EXTENSIONS.include?(ext)
|
|
23
23
|
UI.user_error!("resign: true only works for iOS apps (.ipa); #{File.basename(path)} is #{ext}") if params[:resign] && ext != ".ipa"
|
|
24
24
|
|
|
25
25
|
client = Helper::PcloudyOptions.client(params)
|
|
@@ -33,13 +33,15 @@ module Fastlane
|
|
|
33
33
|
client.wait_for_file(name, timeout: params[:processing_timeout])
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
Helper::PcloudyOptions.export(SharedValues::PCLOUDY_UPLOADED_FILE, name)
|
|
37
|
+
Helper::PcloudyOptions.export(SharedValues::PCLOUDY_APP_FILE, name)
|
|
38
|
+
# Don't leave a re-signed name from an earlier upload in this lane pointing at a different app.
|
|
39
|
+
Helper::PcloudyOptions.export(SharedValues::PCLOUDY_RESIGNED_FILE, nil)
|
|
38
40
|
|
|
39
41
|
if params[:resign]
|
|
40
42
|
name = Helper::PcloudyOptions.resign(client, name, timeout: params[:resign_timeout], interval: params[:poll_interval])
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
Helper::PcloudyOptions.export(SharedValues::PCLOUDY_RESIGNED_FILE, name)
|
|
44
|
+
Helper::PcloudyOptions.export(SharedValues::PCLOUDY_APP_FILE, name)
|
|
43
45
|
end
|
|
44
46
|
|
|
45
47
|
name
|
|
@@ -47,10 +49,11 @@ module Fastlane
|
|
|
47
49
|
UI.user_error!(e.message)
|
|
48
50
|
end
|
|
49
51
|
|
|
50
|
-
# The .ipa from build_app/gym,
|
|
52
|
+
# The .ipa from build_app/gym, else the .apk from gradle, else the .aab from gradle (bundle tasks).
|
|
51
53
|
def self.default_file
|
|
52
54
|
context = Actions.lane_context
|
|
53
|
-
[context[:IPA_OUTPUT_PATH], context[:GRADLE_APK_OUTPUT_PATH]]
|
|
55
|
+
[context[:IPA_OUTPUT_PATH], context[:GRADLE_APK_OUTPUT_PATH], context[:GRADLE_AAB_OUTPUT_PATH]]
|
|
56
|
+
.find { |value| !value.to_s.empty? }
|
|
54
57
|
end
|
|
55
58
|
|
|
56
59
|
def self.format_size(bytes)
|
|
@@ -62,13 +65,15 @@ module Fastlane
|
|
|
62
65
|
#####################################################
|
|
63
66
|
|
|
64
67
|
def self.description
|
|
65
|
-
"Uploads an .ipa or .
|
|
68
|
+
"Uploads an .ipa, .apk or .aab to pCloudy (My Apps), optionally re-signing the .ipa"
|
|
66
69
|
end
|
|
67
70
|
|
|
68
71
|
def self.details
|
|
69
72
|
"Uploads the app built by build_app or gradle (or any file you pass) to pCloudy, waits until pCloudy has " \
|
|
70
73
|
"registered it, and returns the name pCloudy stored it under. pCloudy adds a timestamp to the name when " \
|
|
71
|
-
"a file with the same name already exists, so always use the returned name or
|
|
74
|
+
"a file with the same name already exists, so always use the returned name or PCLOUDY_APP_FILE. " \
|
|
75
|
+
"The names are also set as environment variables, so test scripts started with sh can read " \
|
|
76
|
+
"PCLOUDY_APP_FILE directly."
|
|
72
77
|
end
|
|
73
78
|
|
|
74
79
|
def self.authors
|
|
@@ -91,7 +96,7 @@ module Fastlane
|
|
|
91
96
|
Helper::PcloudyOptions.auth + [
|
|
92
97
|
FastlaneCore::ConfigItem.new(key: :file,
|
|
93
98
|
env_name: "PCLOUDY_APP_PATH",
|
|
94
|
-
description: "Path to the .ipa or .
|
|
99
|
+
description: "Path to the .ipa, .apk or .aab. Defaults to the output of build_app or gradle",
|
|
95
100
|
optional: true,
|
|
96
101
|
type: String),
|
|
97
102
|
FastlaneCore::ConfigItem.new(key: :resign,
|
|
@@ -27,6 +27,15 @@ module Fastlane
|
|
|
27
27
|
]
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
+
# Stores a result in lane_context and in ENV under the same name, so lanes can read
|
|
31
|
+
# lane_context[SharedValues::PCLOUDY_APP_FILE] and test scripts started with sh(...)
|
|
32
|
+
# can read the environment variable PCLOUDY_APP_FILE without any extra wiring.
|
|
33
|
+
# A nil value clears both.
|
|
34
|
+
def self.export(key, value)
|
|
35
|
+
Actions.lane_context[key] = value
|
|
36
|
+
value.nil? ? ENV.delete(key.to_s) : ENV[key.to_s] = value.to_s
|
|
37
|
+
end
|
|
38
|
+
|
|
30
39
|
def self.client(params)
|
|
31
40
|
PcloudyClient.new(username: params[:username],
|
|
32
41
|
api_key: params[:api_key],
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fastlane-plugin-pcloudy
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- pCloudy
|
|
@@ -72,8 +72,8 @@ dependencies:
|
|
|
72
72
|
- !ruby/object:Gem::Version
|
|
73
73
|
version: '3.0'
|
|
74
74
|
description: 'Use pCloudy (device.pcloudy.com or a private cloud) from your fastlane
|
|
75
|
-
lanes: list available real iOS and Android devices, upload the .ipa or .
|
|
76
|
-
just built, and re-sign iOS apps with pCloudy''s certificate.'
|
|
75
|
+
lanes: list available real iOS and Android devices, upload the .ipa, .apk or .aab
|
|
76
|
+
you just built, and re-sign iOS apps with pCloudy''s certificate.'
|
|
77
77
|
executables: []
|
|
78
78
|
extensions: []
|
|
79
79
|
extra_rdoc_files: []
|