I have a problem with a gitlab pipeline. It is an exe file that integrates a web server. The exe is supposed to be created, then installed and started as a service with nssm, tested with Cypress and then the service is supposed to be stopped and uninstalled. So there are four jobs in one pipeline. I have first implemented three jobs: Build, start the file as a service and stop/uninstall the service. The first job creates an artefact and is installed and started as a service by the second job. The problem is that after the service is started, the third job fails. It fails before it even starts. The problem is that the runner tries to delete the exe file before the third job, but it is blocked by the service. The third job is supposed to stop the service.
One possibility would be to run start, test and stop/uninstall in one job, but I don’t like this solution because of the Single Responsibility Principle.
This is the error message I get:
Preparing environment 00:00 Running on SERVER... Getting source from Git repository 00:02 Fetching changes with git depth set to 50... Reinitialized existing Git repository in C:/myrunner/builds/dsgfbfsjngb/0/dwsffsdgfs/project/.git/ Checking out 53f4889a as main... warning: failed to remove app/webserver/access_9111.log: Invalid argument warning: failed to remove app/webserver/debug_9111.log: Invalid argument warning: failed to remove app/webserver/error_9111.log: Invalid argument warning: failed to remove app/webserver/info_9111.log: Invalid argument warning: failed to remove app/webserver/x64/Release/webserver.exe: Invalid argument ERROR: Job failed: exit status 1