I have a Jenkins setup on windows machine,I also have shell script which i want to run using Jenkins. How to run this script any idea.
Install Cygwin on windows
Make use of the
Cygpath plugin for Jenkins
Related
I am running a Jenkins on windows machine with the process of Jenkins.war.
'java -jar jenkins.war'. If I close the command prompt of the service, Jenkins will go down. I want the Jenkins to be up even if the command prompt closed and even after machine reboot, this jenkins to be started. How can we do this on windows machine?
You can use create-windows-service-from-executable to make your jenkins.exe as a service. Or else while installing itself, install as a service rather than starting from command line
I use IntelliJ to launch a gradle build task for my project, but it seems that IntelliJ is using the command prompt (or cmd.exe) to launch the gradle wrapper, because during my build I'm getting the error:
'cp' is not recognized as an internal or external command,
operable program or batch file.
I have git bash installed, and running gradlew build from my bash shell succeeds without any such errors.
Is there a way to tell IntelliJ to use my bash executable to run gradle tasks rather than the default Windows cmd.exe?
I tried changing the default IntelliJ terminal (File->Settings->Terminal) from cmd.exe to my bash.exe, but that didn't work.
I solved this problem by first opening a Git Bash, and then running IntelliJ from there. The IntelliJ terminal is then automatically set to a Bash terminal, and all of the great Bash commands are available to Gradle.
If you want the Git Bash window to close automatically after starting IntelliJ, try running this command from PowerShell:
& git-bash.exe -c 'cmd //c start idea64.exe'
I use the Bash for Windows terminal in Intillij by setting the following as my default terminal.
cmd.exe "/K set LINES=9999&C:\windows\system32\bash.exe"
I'm currently setting up a Jenkins server on Windows 10, in the hope of being able to make the build scripts more cross platform I was hoping to take advantage of the bash environment that is available in Windows 10.
I hoped this could be done just by setting the path to the shell in Jenkins to be the bash executable, however I've encountered some problems with trying to get this to work.
Firstly when I set the path to be C:\Windows\System32\bash.exe but Jenkins didn't seem to be able to see this path.
I assumed this was because Jenkins was running as 32-bit and changed the path to be C:\Windows\sysnative\bash.exe but when I try and use this I get the error
[workspace] $ C:\Windows\sysnative\bash.exe -xe C:\Users\Jenkins\AppData\Local\Temp\hudson4346151084156392102.sh
Error: 0x80070005
Build step 'Execute shell' marked build as failure
I think I'm poking around in the dark a bit so I didn't know if anyone had any experience of trying to use the bash shell on Windows 10 within Jenkins?
The error 0x80070005 usually appears during Windows Update or by specific applications, because of the .DLL files permission being denied. Look at your permissions and then try again.
You can run this on Windows in order to execute a bash shell script:
bash -c /mnt/c/Users/$LOGNAME/Downloads/abc.sh
Make sure that the script is executable (chmod +x)
(Only works on Windwos 10 with a linux subsystem installed)
Just learning about CI and jenkins and wanted to take this concept to the embedded (basically microcontroller) world. The first step is just making sure builds don't break, but then I realized, I don't have a way to execute a build from a shell script on a linux machine (ubuntu server) for a build that usually happens with an IDE on a windows 7 VM. How can I automate opening up a Windows 7 VM and then building an MPLABX project for example.
I'm doing the same thing; a Jenkins server running on Ubuntu, and builds need to happen on Windows with some toolchains that don't always work well for automated builds (IAR in my case).
You can set up a Windows machine/VM with the right tools (incl. Java and git or whatever SCM you use), and install a Jenkins slave agent on it (see https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines).
Connect it to the Jenkins server as node/slave.
Now create a job that uses the "Windows batch command" build step. Your IDE probably has some way to build a project from command line.
Add a post-build step to archive artifacts, i.e. the built files you care about.
-> You can connect your Windows VM as jenkins node and activate Jenkins as service in it.
-> Try to build or run your project from command line. (windows cmd prompt)
-> If your tool has own prompt then invoke your prompt by using normal windows prompt and use.
-> After this you can run your commands in Jenkins using "Windows batch command"
I just started studying Unix shell scripting. I use a Windows XP. Just want to know which all Cygwin packages I need to install to run the bash scripts and commands in Windows.
Thanks
The packages included in the (default) Base installation should be enough for that purpose.
Vixies Cron, will get you started with a linux like crontab for windows. Also cygstart will launch applications very well. Also make sure you install collection of type things from the cygwin setup.