ok i have situation my in current jenkins build. Build steps are like this

sh new_script.sh $USER
helm package $USER
container_name=`helm install $USER-0.1.0.tgz | grep ContainerCreating | awk '{print $1}'`
echo "$container_name"
password=`openssl rand -base64 14`
echo -e "$password\n$password" |  kubectl exec -i $container_name -- passwd

but when i run this job, it fails to load the variable container_name value. How can we resolve this enter image description here

  • The grep is obviously not finding the string ContainerCreating in the output from helm install. You should run that helm command and check what it's actually outputting. – Kusalananda Jan 30 '18 at 10:54
  • @Kusalananda : u were right! i rectified that! there was some issue with environment! now there is a new issue! i have updated the snapshot again! – Mohammed Ali Jan 30 '18 at 11:17
  • I don't know about the actual error that you now get, but if passwd is the standard passwd program to change a password (the root password in this instance), I'd be surprised if it was able to read the password from its standard input. See e.g. stackoverflow.com/questions/714915/… – Kusalananda Jan 30 '18 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.