Last updated: Nov 02, 2022 15:55

To upload APK/IPA/AnyOther/APKS/ZIP files in Azure DevOps(VSTS), you can build artifacts (.apk/.ipa/other/.apks/.zip files) by using a cURL plugin to upload in Perfecto Private/Enterprise & Public Tenant Repository.

Use the following steps to to create job task that can upload a file to the Perfecto Private/Enterprise & Public Tenant repository from the Azure DevOps Build/specific folder.

Step-by-step guide for Perfecto Private/Enterprise Clouds (Using Legacy API)

  1. Add Agent Job to add cURL Upload Files plugin
  2. Choose the Upload task
  3. Choose specific file path OR Build Path wherever deployed is done by project pipeline in Azure DevOps. for e.g. here we are choosing a path for APK "$(System.DefaultWorkingDirectory)/_Demo/resources/ExpenseAppVer1.4.apk"
  4. Choose service Connect or UserName and Password according to need to choose and provide proper information.
  5. Here we are choosing Service connection by creating Perfecto Service Connection by using Manage Link, here already created the service connection for Perfecto
    You can use the project settings to create a service connection by using the Perfecto Private/Enterprises cloud and credentials.
  6. After creating a connection, select the Perfecto service connection name.
  7. Provide the cURL command for uploading the file as mentioned here by the using legacy API for Upload File, which will work for Perfecto Private clouds: "services/repositories/media/PRIVATE:script/ExpenseAppVer1.4.apk?operation=upload&securityToken=eyJhb..._aNRoew" , here the user is trying to upload APK in "PRIVATE:script" perfecto repository path, the same path can be configured in automation framework to pick apk/ipa file.
  8. Use "-X POST" arguments that can be passed to the above mentioned command and enable the checkbox for Control Options to pick a task at execution time.

Screenshot: Step-by-Steps implementation as below.

Step-by-step guide for Perfecto Private / Public-Tenant clouds (Using New API)

  1. Add an Agent Job to add the Command Line plugin.
  2. Select the second version of the command line plugin/task.
  3. Run the cURL command as per the Perfecto File Upload API and with the required parameters.
    Following is a sample command for your reference.

    curl "https://<YourCloudName>-public.app.perfectomobile.com/repository/api/v1/artifacts" -H "Perfecto-Authorization: <YourSecurityTokenToBeMentionedHere>" -H "Content-Type: multipart/form-data" -F "requestPart={\"artifactLocator\":\"PRIVATE:script/ExpenseAppAzureVer1.0.apk\",\"artifactType\":\"ANDROID\",\"override\":true}" -F "inputStream="$(System.DefaultWorkingDirectory)”/Perfecto_DevOps_CD_CT_ProcessDemo-Android-CI/drop/app/build/outputs/apk/debug/app-debug.apk”

    where:

    • <YourCloudName> is the name of your Perfecto cloud.
    • <YourPerfectoSecurityToke> is the security token you generated through the  UI.
    • artifactLocator is the proper path to your Perfecto repository location (this may be to PRIVATE or PUBLIC).
    • inputStream is the proper path of the file (APK/IPA/ZIP/APKS/etc) in Azure DevOps. In this example, $(System.DefaultWorkingDirectory) is pointing to the Azure DevOps working directory.
  4. The agent is executed and the file is uploaded to the location in the public tenant cloud repository.

Screenshot: Step-by-Steps implementation as below