how to run an exe file within a declarative pipeline

291 views
Skip to first unread message

jfern...@forgottenempires.net

unread,
Jan 13, 2021, 7:50:01 AM1/13/21
to Jenkins Users
I am trying to create a pipeline which execute the application with some test scripts once it is built. If done through the CMD it opens the application run a test(AIImprovementsBucket1Test) and exit the application.  I have tried this: 
```
        stage('test') {
            steps{
                script{
                    bat """
                        START  ""  "D:/project/Game/project.exe" SCRIPT=AIImprovementsBucket1Test SCRIPTREPORT=project_Test_Run_Testing.txt
                    """
                } 
            }
        }
```
but then the pipeline just finishes as SUCCESS but it does not open the program. I have tried to take the command and put it inside a .bat file then invoke that file from the pipeline like this:
```
        stage('test') {
            steps{
                 bat ('call "C:/Users/User/Desktop/TestHarnessStuff/testHarness.bat"');
            }
        }
```
but I get the same result, pipeline finishes as success with it does not open the application. I have been going through some SO threads on how to run a .exe file but I just found windows exe runner plugin which cannot be used in declarative pipeline as far as I know. Is there any other way or workaround to do this?

Slide

unread,
Jan 13, 2021, 8:26:51 AM1/13/21
to Jenkins User Mailing List
Is the application a console app or Windows app? What if you add /wait to the START command?

--
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8de030bc-ea81-42eb-b488-ce91d96875d1n%40googlegroups.com.

jfern...@forgottenempires.net

unread,
Jan 13, 2021, 10:26:45 AM1/13/21
to Jenkins Users
it is a windows app (a videogame) adding /wait how so? sorry but I am not good at batch commands, I am learning
Reply all
Reply to author
Forward
0 new messages