Skip to content

PerfectoMobileSA/perfecto-plugin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perfecto Jenkins Plugin

Perfecto Jenkins Plugin provides the ability to auto-create/ re-use existing Perfecto Connect tunnel-id in build environment.

Table of Contents

How to use

Prerequisites

  • Download Perfecto Connect client, extract to any folder.
  • Generate Perfecto Security Token (if not generated already)

Steps to Enable the plugin

  1. Click New Item in Jenkins home page.

  2. Enter Your preferred Item name.

  3. Select any project type except pipeline.

  4. Click OK.

  5. Select Perfecto Connect checkbox under Build Environment (Refer Screenshots section)

  6. Provide Your Credentials.
    a. Select Add option next to Credentials dropdown and select Jenkins.
    b. Select option: “Perfecto” under Kind dropdown in Add Credentials window.
    c. Provide Your Cloud Name, Username and Security Token and click on Add.


  7. Provide Perfecto Connect Path in Perfecto Connect Path text field.
    a. E.g.: - /Users/Mymac/Downloads

  8. Provide Perfecto Connect File Name in Perfecto Connect File Name text field.
    a. E.g.: - Mac – perfectoconnect
    b. E.g.: - Windows – perfectoconnect64.exe or perfectoconnect32.exe

Screenshots

Mac

Windows

Advanced Options

You can provide Advanced options such as Perfecto Connect Additional Parameters, Override Tunnel ID Name and Existing Tunnel ID.

  1. Additional Parameters
    a. Provide Perfecto Connect parameters such as bridgeproxyip, bridgeproxyport
    b. E.g.: - --bridgeproxyip=127.0.0.1 --bridgeproxyport=8888

  2. You can override Tunnel ID Environment Variable name in Override Tunnel ID Name in text field. (The default Jenkins Build Environment variable name is tunnelId)

  3. You can reuse already created Tunnel ID in Existing Tunnel ID text field.


Steps to Stop Perfecto Connect

  1. Add a Post Build task under Post Build Action.

  2. Enter the below script under Script text field.


Perfecto Connect Pipeline Sample:

Steps

  1. Create a new Pipeline and add the below code to pipeline script text field.
  2. Update cloudName, securityToken and perfectoConnectPath as applicable.
import groovy.json.JsonSlurperClassic
import groovy.json.JsonSlurper
 
node {
String cloudName = "<<CLOUD NAME e.g. demo>>";
String securityToken = "<<SECURITY TOKEN>>";
String perfectoConnectPath = "/Users/myMac/Downloads/perfectoconnect";
    environment {
        tunnelId = ""
    }
    stage('perfectoconnect start'){
        if(cloudName.contains("<<")){
             error "Kindly update cloudName, securityToken and perfectoConnectPath"
        }
        String script = perfectoConnectPath + " start  -c " + cloudName + ".perfectomobile.com  -s " + securityToken;
        echo script;
        tunnelId = sh (script: script , returnStdout: true).trim()
        env.tunnelId = "${tunnelId}"
    }
    stage('script'){
        echo "Tunnel id: ${tunnelId}"
    }
    stage('perfectoconnect stop'){
        sh label: '', returnStdout: true, script: perfectoConnectPath + " stop"
    }
}

Usage

Maven Sample

Gradle Sample

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 92.7%
  • HTML 7.3%