'Execute shell' is not listed in a build phase

Keywords: Jenkins - Google Cloud Platform - Technical issue - Other
bnsupport ID: 86787c93-26b1-cf9d-e55c-514c99154d09
Description:
I want to execute a script in a build phase but it is not listed as one of the options in the build phase. I was trying to find a plugin for that but it seems to be built in option in Jenkins. The only one which is available for me “Execute Windows batch command”. Why I do not see it and is there a way to add ‘Execute Shell’? My Junkins runs on Debian.

Hi @nipek0038,

I launched a fresh new Jenkins server on GCP using our Launchpad (version 2.176.1-0 and clicked the “install default plugins” button after the first login. I restarted Jenkins after plugins installation (as requested by the Jenkins wizard) and then created a new job.

I selected a “Freestyle project” type for the new project and the “Execute shell” option appeared in under the “Build” section. Could you tell us which type of job did you create?

image

Regards,
Gonzalo

I created a new project to make sure it was a freestyle project, however it is called diffrently in my language, but I still do not see the ‘execute shell’.

I can try to create a new server on Google, but could you provide me a link to it to make sure I do it correctly.

I’ve set up Jenkins once again, both through bitnami and Google Cloud, but in neither I see "execute shell’

Hi @nipek0038,

Could you tell us in which region are you creating the server so we can try to reproduce your issue? I created mine in europe-west4-a

Regards,
Gonzalo

The one on Google Cloud is in us-central1-f but I have also created one on AWS and I still experience that issue. Is there any chance that you could create one for me and ‘transfer’ it to my account if it actually works for you? I really do not understand how it is possible that it doesn’t work for me. I have created 5 servers already and I have experienced this issue in all of them. What is more, when I try to execute "Windows bash command’ in the build phase, I get this error:

[Test] $ cmd /c call /opt/bitnami/apache-tomcat/temp/jenkins908335358209718902.bat
FATAL: command execution failed
java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
Caused: java.io.IOException: Cannot run program "cmd" (in directory "/opt/bitnami/apps/jenkins/jenkins_home/workspace/Test"): error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)

I have figured it out… I cannot belive that was the problem. It was kind of my mistake. Jenkins translates some descirptions into my native language and it transaleted "Execute shell’ and it is far from the optimal translation so I haven’t even thought to check that out. Sorry for the problem. Thank you for your time.

Hi @nipek0038,

Thanks for the info! I’m glad it worked for you. Could you tell us what is your native language and what is the translation for the “Execute shell” string so it can be of help for others users in the future?

Regards,
Gonzalo

Yes of course. My native language is polish and “Execute shell” is translated to “Uruchom powloke”.

Hi @nipek0038,

Thanks for the info! I’m sure it will be of help for other users having the same issue. We will close this thread as solved. Please do not hesitate to open a new one with any other question you may have.

Best regards,
Gonzalo