rjstelling/bitrise-step-kobiton-upload

How to insert in a workflow on Bitrise?

Closed this issue · 6 comments

First of all thanks for the step!
Which are the steps to integrate in a workflow on bitrise server?
Do you have an example of a workflow bitrise.yml with your step?

thanks a lot

In bitrise.yml file add the following to the the steps section of the workflow you're editing:

- git::https://github.com/rjstelling/bitrise-step-kobiton-upload@0.0.5:
    inputs:
    - kobiton_app_name: "$BITRISE_APP_TITLE"
    - kobiton_app_path: "$BITRISE_SIGNED_APK_PATH"
    - kobiton_app_id: '1234'
    - kobiton_user_id: kobitonbot
    - kobiton_api_key: '012345678-abcde-89ff-ee12-beef01bad02'

You can of course fork the repo and point to the forked version.

Thanks a lot!

Hi again

I replaced the
$BITRISE_SIGNED_APK_PATH
with $BITRISE_IPA_PATH
being an iOS app, set all the parameters
but I got an error 3. I noticed that your code put as filename in json the suffix apk even if we are with ios.
Here the log

  • chmod 0755 /usr/local/bin/ack
  • hash ack
  • APPNAME='Gamma iOS'
  • APPPATH=/Users/vagrant/deploy/gamma.ipa
  • APPID=11189
  • KUSERNAME=pcecchetti
  • KAPIKEY=84e03268-c56f-4664-a324-d52760e5b42f
    ++ echo -n pcecchetti:84e03268-c56f-4664-a324-d52760e5b42f
    ++ base64
  • BASICAUTH=cGNlY2NoZXR0aTo4NGUwMzI2OC1jNTZmLTQ2NjQtYTMyNC1kNTI3NjBlNWI0MmY=
  • echo 'Using Auth: cGNlY2NoZXR0aTo4NGUwMzI2OC1jNTZmLTQ2NjQtYTMyNC1kNTI3NjBlNWI0MmY='
    Using Auth: cGNlY2NoZXR0aTo4NGUwMzI2OC1jNTZmLTQ2NjQtYTMyNC1kNTI3NjBlNWI0MmY=
  • JSON='{"filename":"gamma.apk","appId":11189}'
  • curl --silent -X POST https://api.kobiton.com/v1/apps/uploadUrl -H 'Authorization: Basic cGNlY2NoZXR0aTo4NGUwMzI2OC1jNTZmLTQ2NjQtYTMyNC1kNTI3NjBlNWI0MmY=' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{"filename":"gamma.apk","appId":11189}' -o .tmp.response.json
    | |
    +---+---------------------------------------------------------------+----------+
    | x | git::https://github.com/rjstelling/bitrise-s... (exit code: 3)| 5.14 sec |
    +---+---------------------------------------------------------------+----------+
    | Issue tracker: ...//github.com/rjstelling/bitrise-step-kobiton-upload/issues |
    | Source: https://github.com/rjstelling/bitrise-step-kobiton-upload

I tried with postman to detect error
With JSON='{"filename":"gamma.apk","appId":11189} I get 400 Bad Request
If I edit in
{"filename":"gamma.ipa","appId":11189} I get
{
"appPath": "users/15788/apps/Lenis Intherapy iOS-e8af7fc0-7b17-11e8-91ea-ad1aeedfdca8.ipa",
"url": "https://kobiton-us-east.s3.amazonaws.com/users/15788/apps/Lenis%20Intherapy%20iOS-e8af7fc0-7b17-11e8-91ea-ad1aeedfdca8.ipa?AWSAccessKeyId=AKIAJ7BONOZUJZMWR4WQ&Content-Type=application%2Foctet-stream&Expires=1530263525&Signature=yEhPNoWMrG563q%2Bj%2B6tPuE6aj5k%3D&x-amz-acl=private&x-amz-meta-appid=11189&x-amz-meta-createdby=15788&x-amz-meta-organizationid=185&x-amz-meta-privateaccess=false&x-amz-tagging=unsaved%3Dtrue"
}

So I presume we should add another parameter to step with selector to chose if ios or android...

I've now merged your PR 👍🏼

@rjstelling I still get the error using in bitrise workflow

On postman the first call is perfect and returns
"appPath": "users/15788/apps/iOS-e6ee6600-7b9f-11e8-a068-5789728060c2.ipa",
"url": "https://kobiton-us-east.s3.amazonaws.com/users/15788/apps/iOS-e6ee6600-7b9f-11e8-a068-5789728060c2.ipa?AWSAccessKeyId=AKIAJ7BONOZUJZMWR4WQ&Content-Type=application%2Foctet-stream&Expires=1530321933&Signature=jCih5ZVCiX3D08fyxfxnkcvRoKI%3D&x-amz-acl=private&x-amz-meta-appid=11189&x-amz-meta-createdby=15788&x-amz-meta-organizationid=185&x-amz-meta-privateaccess=false&x-amz-tagging=unsaved%3Dtrue"
}

On bitrise log the step breaks at the first call
https://api.kobiton.com/v1/apps/uploadUrl

Could be an error in code trying to estract the json answer?
Because the second call to upload the file to amazon s3 is never logged by bitrise