how to pass password during jarsigner via jenkins pipeline

49 Views Asked by At

i have create a pipeline for jar signer so i want to pass the password for my jks.

if any one know how to pass the password in pipeline script please let me know.

please check below script which i have created for this.

Script:

pipeline { agent any environment { KEYSTORE_PASSWORD = credentials('Torus@321') // Use the ID you assigned to the credentials }

stages 
{
    // Your other pipeline stages
    stage('Sign JAR/APK') 
    {
        steps 
        {
            bat 'jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\Configuration\\UI\\APK\\apk.heytorus.com\\hey_torus_keystore.jks -storepass "$KEYSTORE_PASSWORD" C:\\ProgramData\\Jenkins\\.jenkins\\workspace\\apk.heytorus.com\\PROTO-UI\\platforms\\android\\app\\build\\outputs\\bundle\\release\\app-release.aab Key0'
       
        }
    }
}

}

0

There are 0 best solutions below