Im using expect to inject a password into an openssl command called from a 
make file (and spawned by expect).

However, Im not able to pass the secret. Any suggestions on why this is 
happening?

makeFileWith.mk contains an openssl command requiring a secret

stage ('Deploy') {
   withCredentials([string(credentialsId: 'secretText', variable: 
'varSecretText')]) {

        sh """#!/usr/bin/expect

        puts "SECRET $varSecretText"

        exp_internal 1 
        spawn make -f makeFileWith.mk
         
        expect "Enter Password:" {
           send \"${varSecretText}\n\"
        }
        """
   }
}

Output is

SECRET ****
...

expect: does "" (spawn_id exp3) match glob pattern "Enter Password:"? no

Is this Jenkins Bug or do I need something more / another approach ?



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/12a74c78-9731-4980-b24d-ecd2c66b7b18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to