Skip to content

Commit f7ce849

Browse files
Add files via upload
0 parents  commit f7ce849

6 files changed

Lines changed: 280 additions & 0 deletions

File tree

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018 Marcel Kalveram
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.

README.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Perfecto-upload
2+
3+
For remote device testing on Perfecto. This step allows you to upload an APK/IPA file to Perfecto cloud
4+
5+
6+
## How to use this Step
7+
8+
Can be run directly with the [bitrise CLI](https://github.com/bitrise-io/bitrise),
9+
just `git clone` this repository, `cd` into it's folder in your Terminal/Command Line
10+
and call `bitrise run test`.
11+
12+
*Check the `bitrise.yml` file for required inputs which have to be
13+
added to your `.bitrise.secrets.yml` file!*
14+
15+
Step by step:
16+
17+
1. Open up your Terminal / Command Line
18+
2. `git clone` the repository
19+
3. `cd` into the directory of the step (the one you just `git clone`d)
20+
5. Create a `.bitrise.secrets.yml` file in the same directory of `bitrise.yml`
21+
(the `.bitrise.secrets.yml` is a git ignored file, you can store your secrets in it)
22+
6. Check the `bitrise.yml` file for any secret you should set in `.bitrise.secrets.yml`
23+
* Best practice is to mark these options with something like `# define these in your .bitrise.secrets.yml`, in the `app:envs` section.
24+
7. Once you have all the required secret parameters in your `.bitrise.secrets.yml` you can just run this step with the [bitrise CLI](https://github.com/bitrise-io/bitrise): `bitrise run test`
25+
26+
An example `.bitrise.secrets.yml` file:
27+
28+
```
29+
envs:
30+
- A_SECRET_PARAM_ONE: the value for secret one
31+
- A_SECRET_PARAM_TWO: the value for secret two
32+
```
33+
34+
## How to create your own step
35+
36+
1. Create a new git repository for your step (**don't fork** the *step template*, create a *new* repository)
37+
2. Copy the [step template](https://github.com/bitrise-steplib/step-template) files into your repository
38+
3. Fill the `step.sh` with your functionality
39+
4. Wire out your inputs to `step.yml` (`inputs` section)
40+
5. Fill out the other parts of the `step.yml` too
41+
6. Provide test values for the inputs in the `bitrise.yml`
42+
7. Run your step with `bitrise run test` - if it works, you're ready
43+
44+
__For Step development guidelines & best practices__ check this documentation: [https://github.com/bitrise-io/bitrise/blob/master/_docs/step-development-guideline.md](https://github.com/bitrise-io/bitrise/blob/master/_docs/step-development-guideline.md).
45+
46+
**NOTE:**
47+
48+
If you want to use your step in your project's `bitrise.yml`:
49+
50+
1. git push the step into it's repository
51+
2. reference it in your `bitrise.yml` with the `git::PUBLIC-GIT-CLONE-URL@BRANCH` step reference style:
52+
53+
```
54+
- git::https://github.com/user/my-step.git@branch:
55+
title: My step
56+
inputs:
57+
- my_input_1: "my value 1"
58+
- my_input_2: "my value 2"
59+
```
60+
61+
You can find more examples of step reference styles
62+
in the [bitrise CLI repository](https://github.com/bitrise-io/bitrise/blob/master/_examples/tutorials/steps-and-workflows/bitrise.yml#L65).
63+
64+
## How to contribute to this Step
65+
66+
1. Fork this repository
67+
2. `git clone` it
68+
3. Create a branch you'll work on
69+
4. To use/test the step just follow the **How to use this Step** section
70+
5. Do the changes you want to
71+
6. Run/test the step before sending your contribution
72+
* You can also test the step in your `bitrise` project, either on your Mac or on [bitrise.io](https://www.bitrise.io)
73+
* You just have to replace the step ID in your project's `bitrise.yml` with either a relative path, or with a git URL format
74+
* (relative) path format: instead of `- original-step-id:` use `- path::./relative/path/of/script/on/your/Mac:`
75+
* direct git URL format: instead of `- original-step-id:` use `- git::https://github.com/user/step.git@branch:`
76+
* You can find more example of alternative step referencing at: https://github.com/bitrise-io/bitrise/blob/master/_examples/tutorials/steps-and-workflows/bitrise.yml
77+
7. Once you're done just commit your changes & create a Pull Request
78+
79+
80+
## Share your own Step
81+
82+
You can share your Step or step version with the [bitrise CLI](https://github.com/bitrise-io/bitrise). If you use the `bitrise.yml` included in this repository, all you have to do is:
83+
84+
1. In your Terminal / Command Line `cd` into this directory (where the `bitrise.yml` of the step is located)
85+
1. Run: `bitrise run test` to test the step
86+
1. Run: `bitrise run audit-this-step` to audit the `step.yml`
87+
1. Check the `share-this-step` workflow in the `bitrise.yml`, and fill out the
88+
`envs` if you haven't done so already (don't forget to bump the version number if this is an update
89+
of your step!)
90+
1. Then run: `bitrise run share-this-step` to share the step (version) you specified in the `envs`
91+
1. Send the Pull Request, as described in the logs of `bitrise run share-this-step`
92+
93+
That's all ;)

assets/icon.svg

Lines changed: 1 addition & 0 deletions
Loading

bitrise.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
format_version: 4
2+
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
3+
4+
app:
5+
envs:
6+
# If you want to share this step into a StepLib
7+
- BITRISE_STEP_ID: perfecto-upload
8+
- BITRISE_STEP_VERSION: "0.0.6"
9+
- BITRISE_STEP_GIT_CLONE_URL: https://github.com/PerfectoCode/Bitrise_Perfecto_FileUpload.git
10+
- MY_STEPLIB_REPO_FORK_GIT_URL: https://github.com/PerfectoCode/bitrise-steplib
11+
12+
workflows:
13+
test:
14+
steps:
15+
- change-workdir:
16+
title: Switch working dir to test / _tmp dir
17+
description: |-
18+
To prevent step testing issues, like referencing relative
19+
files with just './some-file' in the step's code, which would
20+
work for testing the step from this directory directly
21+
but would break if the step is included in another `bitrise.yml`.
22+
run_if: true
23+
inputs:
24+
- path: ./_tmp
25+
- is_create_path: true
26+
- path::./:
27+
title: Perfecto Upload File to Repository Test
28+
description: |-
29+
Uploads an IPA/APK file to Perfecto cloud
30+
To test this, you need a Perfecto account with a valid access key and an IPA/APK path from which to upload
31+
run_if: true
32+
inputs:
33+
- upload_path: $BITRISE_APK_PATH
34+
- perfecto_cloudname: $PERFECTO_CLOUD_NAME
35+
- perfecto_accesskey: $PERFECTO_ACCESS_KEY
36+
- perfecto_filepath: $PERFECTO_FILE_PATH
37+
- script:
38+
inputs:
39+
- content: |
40+
#!/bin/bash
41+
echo "This output was generated by the Step (EXAMPLE_STEP_OUTPUT)"
42+
43+
# ----------------------------------------------------------------
44+
# --- workflows to Share this step into a Step Library
45+
audit-this-step:
46+
steps:
47+
- script:
48+
inputs:
49+
- content: |-
50+
#!/bin/bash
51+
set -ex
52+
stepman audit --step-yml ./step.yml
53+
54+
share-this-step:
55+
envs:
56+
# if you want to share this step into a StepLib
57+
- MY_STEPLIB_REPO_FORK_GIT_URL: $MY_STEPLIB_REPO_FORK_GIT_URL
58+
- BITRISE_STEP_ID: $BITRISE_STEP_ID
59+
- BITRISE_STEP_VERSION: $BITRISE_STEP_VERSION
60+
- BITRISE_STEP_GIT_CLONE_URL: $BITRISE_STEP_GIT_CLONE_URL
61+
description: |-
62+
If this is the first time you try to share a Step you should
63+
first call: $ bitrise share
64+
65+
This will print you a guide, and information about how Step sharing
66+
works. Please read it at least once!
67+
68+
As noted in the Step sharing guide you'll have to fork the
69+
StepLib you want to share this step into. Once you're done with forking
70+
the repository you should set your own fork's git clone URL
71+
in the `.bitrise.secrets.yml` file, or here in the `envs` section,
72+
as the value of the `MY_STEPLIB_REPO_FORK_GIT_URL` environment.
73+
74+
You're now ready to share this Step, just make sure that
75+
the `BITRISE_STEP_ID` and `BITRISE_STEP_VERSION`
76+
environments are set to the desired values!
77+
78+
To share this Step into a StepLib you can just run: $ bitrise run share-this-step
79+
80+
81+
Once it finishes the only thing left is to actually create a Pull Request,
82+
the way described in the guide printed at the end of the process.
83+
before_run:
84+
- audit-this-step
85+
steps:
86+
- script:
87+
inputs:
88+
- content: |-
89+
#!/bin/bash
90+
set -ex
91+
bitrise share start -c "${MY_STEPLIB_REPO_FORK_GIT_URL}"
92+
bitrise share create --stepid "${BITRISE_STEP_ID}" --tag "${BITRISE_STEP_VERSION}" --git "${BITRISE_STEP_GIT_CLONE_URL}"
93+
bitrise share finish

step.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
set -e
3+
set -x
4+
curl -X POST -T ${upload_path} "https://"${perfecto_cloudname}"/services/repositories/media/"${perfecto_filepath}"?operation=upload&securityToken="${perfecto_accesskey}""

step.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
title: Perfecto Upload
2+
summary: |
3+
Upload APK/IPA files to Perfecto cloud repository
4+
description: |
5+
Upload your build files to Perfecto for remote device testing. Upload your IPA/APK file to Perfecto repository
6+
source_code_url: https://github.com/PerfectoCode/Bitrise_Perfecto_FileUpload
7+
support_url: https://github.com/PerfectoCode/Bitrise_Perfecto_FileUpload/issues
8+
website: https://github.com/PerfectoCode/Bitrise_Perfecto_FileUpload
9+
source:
10+
git:
11+
commit:
12+
host_os_tags:
13+
- osx-10.10
14+
project_type_tags:
15+
- ios
16+
- android
17+
- xamarin
18+
- react-native
19+
- cordova
20+
- ionic
21+
- flutter
22+
type_tags:
23+
- deploy
24+
toolkit:
25+
bash:
26+
entry_file: step.sh
27+
deps:
28+
brew:
29+
- name: curl
30+
apt_get:
31+
- name: curl
32+
is_requires_admin_user: true
33+
is_always_run: false
34+
is_skippable: false
35+
run_if: ""
36+
inputs:
37+
- opts:
38+
description: |
39+
This usually gets generated by the the "Gradle Runner" or "XCode Archive & Export" step
40+
is_required: true
41+
is_sensitive: true
42+
summary:
43+
The app file you want to upload to Perfecto, usually $BITRISE\_APK\_PATH
44+
or $BITRISE\_IPA\_PATH
45+
title: A Bitrise generated APK or IPA path
46+
upload_path: $BITRISE_APK_PATH
47+
- perfecto_accesskey:
48+
opts:
49+
description: |
50+
The security token you use to log into your Perfecto account
51+
is_required: true
52+
is_sensitive: true
53+
summary: Your perfecto access key.
54+
title: Perfecto access key
55+
- perfecto_cloudname:
56+
opts:
57+
description: |
58+
The perfecto cloud name
59+
is_required: true
60+
summary: Your perfecto cloud name. Ex - abc.perfectomobile.com
61+
title: Perfecto cloud name
62+
- perfecto_filepath:
63+
opts:
64+
description: |
65+
File path on perfecto cloud repository where it would be stored
66+
is_required: true
67+
summary: Your perfecto repository path
68+
title: Perfecto repository path

0 commit comments

Comments
 (0)